Hello everyone. I always run Perl scripts on a web server with

#!/usr/bin/perl -T

at the top (i.e. taint mode on). I try to do the same when testing scripts on my local machine and this often works fine. But somtimes (when running from the command line) I get:

"-T" is on the #! line, it must also be used on the command line at forum.cgi line 1

I have tried using the T flag on the command line like it says but this has no effect. This happens whether I use #!"C:\Perl\bin\perl -T" (the actual location of Perl on my machine) or the UNIX style #!/usr/bin/perl -T. Does anyone know why this happens? Any help appriciated.

Steven.

EDIT: I do most testing of the app I am working on with apache on my machine. This reports a server error when I try to use taint mode as described above, which I assume is the same problem manifesting itself.

Recommended Answers

All 3 Replies

windows does not read/use the shebang line. I don't tknow what the work-around would be for this problem. It works with the http server (apache at leat) because apache for windows does some kind of unix/shebang line emulation.

Can you use taint; ?

good guess, but no, there is no taint module (or taint pragma).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.