Joe Mecklin wrote:
> 
> i'm trying to use system() to run ptal-pml to retrieve pml values from
> hp printers; my problem is how to redirect the system() output.  the
> variations i've tried with backticks or qx// are not accomplishing
> anything useful - i get either a numeric value or an empty string.  this
> is the command i'm running:
> 
> $system_results = system("usr/bin/ptal-pml hpjd:$ip get-$type $value");
> 
> can someone detail the proper syntax i need in order for $system_results
> to receive the correct output?  or better still, the syntax to redirect
> to a file (i do have a filehandle open and closed appropriately).


The correct syntax is to use backticks:

$ptal_pml_results = `usr/bin/ptal-pml hpjd:$ip get-$type $value`;

But perhaps the program is writing to standard error instead of standard
output.

$ptal_pml_results = `usr/bin/ptal-pml hpjd:$ip get-$type $value 2>&1`;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to