On Sunday, April 28, 2002, at 05:25 , John Brooking wrote:
> --- drieux <[EMAIL PROTECTED]> wrote: [..] >> is that if people did the decent bit >> >> #!/usr/bin/perl -w >> use strict; >> >> then whether it is dos or unix formatted - it will >> still work > > How do you mean "it will still work"? Doesn't -w and > "use strict" just make Perl more picky about what it > will accept and raise its complaint level? How would > this impact how it interprets line ends? phase 0 - the perl interpretor would be called as /usr/bin/perl which is where the code is, vice the /usr/bin/perl^M which post pends a "\r" token - and the unix system does the 'getFileByName' thing and does not find it. since the ^M is hanging off the "-w" and not off the actual 'interpretor' - perl then reads that as a command line argument to read the rest of the text. the crazy part is that perl has no crisis with how you do 'end of line' - as well as the 'delimiter' for command line arguments..... my test case was to take a 'legitimate' piece of perl code that work in the form ./dumb.cgi on a unix box and then run unix2dos dumb.cgi dumbDos.cgi so that the later had the 'dos' style coding - and it worked when I ran it as ./dumbDos.cgi on a unix box - crawl down into the source code for the perl 5.6.1 release and chase it down you will see what I mean... when I converted the file to the 'mac side' it became obvious to me what was going on. remember that unix uses \n = x0A dos does the twins \r\n == x0D x0A so there is always the "newline" token there to be found but mac merely usese \r hence no 'embedded' "\n" for perl to deal with.... so the interpretation problem is not as hard on the Unix Side. Most folks forget that in the unix world the stty is what converts the single binary into the '<CR><NL>' behavior... As more folks come to perl in the win32 side of it all we have been running into the 'how does this work' problems so getting a bit more in detail about the detail may help folks understand the problem. > [..] > Disclaimer: I have no connection to Ultra-Edit other > than satisfied registered customer. This "promo" was > prompted only by the earlier discussion of end-of-line > characters. I personally run bbedit 6.5 on an OSX box and have not had any problem - since I save everything unix style anyway. No need to worry about where I am. On *nix boxes I run vi. On windows box - there is always cygwin, which has make, and vi and perl - who could ask for anything more... ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]