kendroid has asked for the wisdom of the Perl Monks concerning the following question:
Here's what I've got:
foreach $one (@ARGV) { open(STDOUT, ">/dev/null"); # Various expect statements that telnet to routers # listed in @ARGV and back up several files. close(STDOUT); # this is what I'd like to be printed to STDOUT. print "Done with backups for this machine."; }
(I'm using expect rather than Net::Telnet because the backup commands that are run usually require additional input before returning a prompt.)
Is there any easy way direct output to either STDOUT or /dev/null?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Quick Redirection Question
by traveler (Parson) on Apr 27, 2001 at 23:08 UTC | |
|
Re: Quick Redirection Question
by suaveant (Parson) on Apr 27, 2001 at 22:38 UTC |