Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Looking for Perlish log out put

by Sun751 (Beadle)
on Jul 16, 2009 at 00:29 UTC ( [id://780517]=perlquestion: print w/replies, xml ) Need Help??

Sun751 has asked for the wisdom of the Perl Monks concerning the following question:

I am working on a script where I am suppose to run some command and if it fails generate the log file and this is what I have done,
system($command); if ($? == -1 ) { $step = $step -1; display_err($command,$step); exit; } sub display_err { my ($cmd,$step)= @_; open(LOG, ">>release_log.log")|| die "Unable to open release_log.log f +or output: $!\n"; print LOG <<HEADING; ================================================================== HEADING print LOG "[Command Execution Failed]\n"; print LOG "Command: $cmd\n"; print LOG "Command Succeful upto: $step\n"; print LOG scalar localtime(); close LOG; }
Any body have any suggestion how can I make it more Perlish?Please,

Replies are listed 'Best First'.
Re: Looking for Perlish log out put
by apl (Monsignor) on Jul 16, 2009 at 01:33 UTC
    You can look at nearly any of these, resulting from a simple query of Log at search.cpan.org .
Re: Looking for Perlish log out put
by Anonymous Monk on Jul 16, 2009 at 01:19 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found