hardburn has asked for the wisdom of the Perl Monks concerning the following question:

I have a rather long shabang line on my server: '#!/usr/local/bin/perl5.8.0'. Using a -T, even as the first option, spews errors because the -T comes too late in the line.

Now the way to shut off taint mode within a lexical scope is "no re 'taint'", but is it OK to do the opposite?

#!/usr/local/bin/perl5.8.0 use re 'taint'; ...

Personally, I find this method more asethetic than -T, even if the shabang line wasn't too long.

Is there anything naive about doing it this way?

Replies are listed 'Best First'.
Re: -T or "use re 'taint'"
by Abigail-II (Bishop) on Nov 22, 2002 at 16:30 UTC
    I'm a bit surprised you are getting this error. "#!/usr/local/bin/perl5.8.0 -T" is only 29 characters, which is less than 32. Also, generally systems that can't deal with long she-bang lines ignore the rest, without issueing an error message about what's in there.

    Now, there is a Perl error Too late for "-T" option. It's documented in man perldiag, and the case it describes looks remarkably like the case you do. Consult the manual page.

    Abigail

Re: -T or "use re 'taint'"
by joe++ (Friar) on Nov 22, 2002 at 16:25 UTC
    Are you sure that this error comes from your shebang line being too long?

    The "Too late for -T" error is typically displayed if you try to syntax check with $ perl -c myscript.pl Which you should do like this instead: $ perl -cT myscript.pl

    --
    Cheers, Joe

      Ahh, that was the problem. I was trying to check the syntax like that. Thanks!

Re: -T or "use re 'taint'"
by John M. Dlugosz (Monsignor) on Nov 22, 2002 at 20:59 UTC
    The way I read it, "no re 'taint'" doesn't turn off taint mode at all. It controls whether the $1 etc strings are tainted or not, and "no" is the normal case. Am I missing something?