in reply to Re^2: Taint error in Printer module
in thread Taint error in Printer module
OK, I can see how that might have been confusing. The module is Printer::Unix. It's bundled with Printer, rather than being provided as a separately distributed module. You can find it as follows:
There's probably additional confusion because the source code for Printer has
require Printer::Unix;
but the source code for Printer::Unix has no package statement. The module is Printer::Unix but its namespace is Printer.
The code I suggested should be added to your program as I originally stated: nothing has changed in that respect.
As a general rule, you should not make changes to module code you've installed from CPAN. If you have made any changes, you should reverse them: if in doubt, reinstall the module.
You should be able to create a SSCCE fairly easily. Start with code similar to what I suggested; add use Printer;; then your sub printX {...}; then a call to exercise it (printX(@args)).
Important: Note that I used printX. You don't have to call it that; but do not call it print: that's the name of a core function (print) and could easily cause problems.
The Printer module only works with a limited number of platforms that I don't have available. I'd be happy to look at your SSCCE code but I'm not in a position to run and test it.
You should also change your current indirect object syntax:
my $prn=new Printer('linux' => '6L',);
to
my $prn = Printer::->new(linux => '6L');
See Indirect Object Syntax for an explanation. Note the emboldened text: "... use of this syntax is discouraged ...".
— Ken
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Taint error in Printer module
by ksublondie (Friar) on Aug 09, 2017 at 17:17 UTC |