in reply to printing and logging to a file
#!/usr/local/bin/perl open (OUT, ">/tmp/out.file"); $fh = select (OUT); $| = 1; select($fh); print STDOUT "Hello!\n"; # prints to stdout print "Hello!\n"; # prints to $fh = /tmp/out.file as no filehandle has been statedSo, in the above example, we have selected a filehandle - Am I correct in believing that unless explicitly stated, all output will be directed to OUT - the selected filehandle?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: printing and logging to a file
by blakem (Monsignor) on Jan 09, 2002 at 05:04 UTC |