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