Hi Peter,

Look at the perlopentut man page:

perldoc perlopentut

That will show you how to open a file(s). Then, you can just write to them. If
I want all my 'print' statements in a script to print to a specific file, I
generally do something like:

sub DEBUG () { 1 }; # Or some level of debugness

open(LOG, ">>$log") or die "Can't open $log: $!";
select(LOG);

print "I will go to $log" if DEBUG;
print "I may go to the log" if DEBUG > 1;
etc...

close LOG;

But, YMMV. Someone else may have other tricks they use for logging.

Cheers,
Kevin

On Thu, Apr 26, 2001 at 12:32:13PM -0700, Peter Lemus ([EMAIL PROTECTED]) spew-ed 
forth:
> Hi, Guys,
> 
> I'm running a perl script that generates lots of error
> messages and successful completion messages.  Please
> give me some tips on how can I put all this data to a
> log file.
> 
> thanks,
> 
> =====
> Peter Lemus
> Computer Networks Engineer
> [EMAIL PROTECTED]
> My Dad always tought me; when you do good; expect to receive good; when you do bad; 
>expect the bad...sooner or later.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Seen the city, seen the zoo, traffic light won't let me through.
        -- Phish (Slave to the Traffic Light)

Reply via email to