Just another Perl shrine | |
PerlMonks |
Re: Taint error in Printer moduleby kcott (Archbishop) |
on Aug 05, 2017 at 06:29 UTC ( [id://1196788]=note: print w/replies, xml ) | Need Help?? |
G'day ksublondie, What you've presented in your OP has all sorts of problems. Look at deleted @ENV{...): that should be delete not deleted; and the right parenthesis should be a right brace. You've also linked to Printer. The source code for that Module is quite different from what you've posted (as "the code for Printer is"): it has use Env qw(PATH), not the syntactically incorrect code you show (')' instead of '}' again); it also has no code which matches open PRINTER! The upshot of this is that we don't know what code you're really running, nor what module you're really using. As I'm sure you'll realise, this makes it difficult to help you. use, and sub definitions, occur at compile time. Your modification of $ENV{PATH} occurs at runtime. I suspect your problem is related to this. Your taint error is most often caused by a PATH ending with ':.'; although, any relative pathname could be the problem. There could be other reasons, too. I suggest you put code like the following at the very start of your program; immediately following the shebang line would probably be best.
In case you didn't know, BEGIN occurs at compile time. By putting this code first, %ENV is modified before any other compile time actions. If you copy and paste code, you won't end up with the typographical errors (probably caused, at least in part, by entering by hand) that your OP has in multiple places. Also, please check that all links actually link to the indicated information, and any references accurately reflect the sources you provide. Update: Minor typo fix: s/you program/your program/ — Ken
In Section
Seekers of Perl Wisdom
|
|