Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Taint error in Printer module

by ksublondie (Friar)
on Aug 09, 2017 at 17:17 UTC ( [id://1197120]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Taint error in Printer module
in thread Taint error in Printer module

I'll go back and make the changes you suggested. I thought I used the exact syntax for Printer stated in the documentation.

Here's the kicker, it's not always failing. Even though I'm explicitly setting ENV{PATH} in all 3 files, every 3 or so times the script runs, it somehow resets the ENV{PATH} to the original value. Only when I explicitly reset it right before it fails in Printer::Unix.pm does it get the correct ENV{PATH}.

$ENV{PATH}='/usr/bin'; warn "path=$ENV{PATH}\n"; open PRINTER, "| $self->{print_command}->{linux}-{command}" or Carp::croak..
...And then it will again randomly fail (more like every 6th running instead of every 3rd), with the new error Can't open printer connection to lp -d 6L.

ETA: However, if my code is:

warn "path=$ENV{PATH}\n"; open PRINTER, "| $self->{print_command}->{linux}-{command}" or Carp::croak..
(without the redundant 4th reset of ENV{PATH}), sometimes the warning output shows the correct PATH, sometimes, it doesn't.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1197120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-28 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found