Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: printing to STDOUT and a Logfile (cross-platform sub)

by ybiC (Prior)
on Oct 29, 2002 at 01:22 UTC ( [id://208650]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # print messages to both console and logfile
    sub PrintLogCon {
      print @_;
      print(LOG @_) or die "Error printing to $logfile: $!";
      }
    
  2. or download this
    use warnings;
    use strict;
    ...
    ...
    close LOG or die "Error closing $logfile: $!";
    __END__
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://208650]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-16 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found