Transferring perl programs from MS to FreeBSD

Richard Smith richard
Wed Aug 25 12:37:20 BST 1999


Charles Brewster wrote:
> 
> 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.

Try looking at the file using ee, because DOS EOL codes will show up as
a ^M and can be easily deleted. I suspect that emacs is being too clever
and just handling it.

Other than that, I can't reproduce the problem on 3.2 with and without
DOS EOL, although this problem has tripped me up in the past with shell
scripts.

HTH,
Richard.






More information about the Ukfreebsd mailing list