Transferring perl programs from MS to FreeBSD

Charles Brewster ecliptica.ww at virgin.net
Wed Aug 25 11:59:58 BST 1999


Here's a peculiar one:

If I write a simple perl program in MS DOS using edit.com, something like:

$phrase = "Hello World!\n\n";
print $phrase;

save it as hellow.pl and run it with the perl interpreter, it works fine.

If I then boot FreeBSD, mount the DOS partition, mcopy the perl program
file across, change the permissions with chmod 777, and add as the first line:

#!/usr/bin/perl -w

(which works fine with perl scripts I write in FreeBSD with emacs),
I can't get the perl program originally written in MS DOS to work.

Trying to run it with ./hellow.pl doesn't work, so I tried changing the
file name to hellow without the MS DOS extension (for no particular good
reason, but just trying to get things to look as much the same as
possible), still nothing. All I get is the FreeBSD shell prompt back on the
next line as if I had just pressed [enter] on its own at the prompt.

I thought perhaps there was some invisible difference in the new line
codes, so I tried re-doing each end-of-line in emacs, but still no joy.

Am I doing something really stupid here, or is there some weird
incompatibility?

Has anybody else had problems with this??

Many thanks for any suggestions ...






More information about the Ukfreebsd mailing list