Angus Laycock wrote:
> 
> Hi,

Hello,

> I want to print messages from a script to either
> STDOUT or STDERR depending on a value of a variable.
> I want to control where I send the print statements
> to. Can I do something like this or are there other
> ways to control the target I send my message to. I'm
> hoping there are lots of other ways.
> 
> if ($out) { $whereitsggoing = STDERR } else { $whereitsggoing = STDOUT }
> 
> print $whereitsgoing "My message\n";

Here is one way to do it:

print { $out ? STDERR : STDOUT } "My message\n";



John
-- 
use Perl;
program
fulfillment

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

Reply via email to