in reply to Re: Re: Re: shebang line
in thread shebang line
Read carefully: "This leads me to believe that the shebang line in the imported file is ignored."
By imported, perlmongrel is referring to used or required files, NOT the main .pl file. Since in these cases Perl simply opens and reads the files, the shell and the kernel are out of the picture (at least from the execve perspective); this happens well after any shebang interpretation. So in that sense, he is right.
I believe, however, that Perl itself may, upon detecting a shebang line in an included file, honor at least the -w and -T switches, if present. The former in the usual sense, and the latter only insofar as it has to match the Taint-mode-ness of the main .pl file. However, I cannot remember where I read this and am not particularly certain of either of these points. Certainly, Perl WILL ignore the path to the perl interpreter if it differs from that of the running instance.
As to having an "invisible" CR (^M) *between* #!/path/to/perl and -w, balderdash! No Win/DOS editor would put anything but CR-LF into a text file, and those only go at the ends of lines. So if anything, adding a -w would move an extraneous CR (inserted by a Win/DOS editor) from right after #!/path/to/perl to just after the -w, in which location, as I explained in an earlier post, it is ignored by Perl.
Using ASCII mode to FTP the files, or using one of several CR-stripping mechanisms (of which your regex is one) would emeliorate the problem.
dmm
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re(4): shebang line
by perlmongrel (Acolyte) on Jan 05, 2002 at 03:09 UTC |