Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: redirecting output to STDERR and STDOUT

by helgi (Hermit)
on Feb 22, 2005 at 15:34 UTC ( #433358=note: print w/replies, xml ) Need Help??


in reply to redirecting output to STDERR and STDOUT

I don't know what the "correct" way to do this is, but here's one way:

#!/usr/bin/perl use warnings; use strict; my $logfile ='/tmp/foo.txt'; open STDERR, ">>", $logfile or die "Cannot redirect STDERR to $logfile +:$!\n"; my $in = 'C:/tmp/in.txt'; open IN, $in or die "Cannot open $in:$!\n"; close IN; close STDERR;

--
Regards,
Helgi Briem
hbriem AT simnet DOT is

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://433358]
help
Chatterbox?
[Discipulus]: erix the right order of books is: The Three Musketeers, Twenty Years After, The Count of Moret; The Red Sphinx (not in the cycle but a must read!), The Vicomte de Bragelonne

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-05-24 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?