in reply to Re^6: .pl or shebang
in thread .pl or shebang

No, -T is doing its job.
No, it's not. The message you got is not a warning, the program terminates after that. Save this as foo.pl:
#!perl -T print 42;
then run it:
C:\Users\burak\Desktop>perl foo.pl "-T" is on the #! line, it must also be used on the command line at fo +o.pl line 1. C:\Users\burak\Desktop>
try again with -T on the commandline:
C:\Users\burak\Desktop>perl -T foo.pl 42 C:\Users\burak\Desktop>

Replies are listed 'Best First'.
Re^8: .pl or shebang
by Anonymous Monk on May 16, 2009 at 05:06 UTC
    No, it's not. The message you got is not a warning, the program terminates after that.
    EXACTLY!!!!!! That is what is supposed to happen.

      -T's job is to turn on taint mode. When on the shebang line, it does not do its job. It may be understandable that it doesn't work, but it cannot be placed on the shebang line instead of the command line as previously stated.

        ??? It dies, protecting your program from running without taint, ie it works.
          A reply falls below the community's threshold of quality. You may see it by logging in.

      No. What it is supposed to do is to run the script and die if the script attempts to do anything dangerous with not validated input. The "This is an error because, by the time Perl discovers a -T in a script, it's too late to properly taint everything from the environment. So Perl gives up." in perldiag seems to suggest that this is an implementation issue rather than a deliberate decision. Which is a shame. It would make a lot of things much easier.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.