Perl Script Template with basic logging functions
[code language=”perl”] #! perl #=============================================================================== # Objective: # ———- # # Sample Perl script template with basic logging functions # # # $Header: $ #=============================================================================== # Include Modules #=============================================================================== use strict; use warnings; use Pod::Usage; use Getopt::Long qw(:config no_ignore_case bundling); #=============================================================================== # Global Variables Declaration #=============================================================================== use vars qw($DEBUG); #=============================================================================== # Prototypes Section #=============================================================================== sub DoAction; sub InitGlobals; sub ProcessArgs; sub Info {my ($mesg) = @_; print "INFO: $mesg\n";} sub MyErr {my ($mesg) = @_; print "ERROR: $mesg\n"} sub MyWarn {my ($mesg) = @_; print "WARNING: $mesg\n";} sub MyDie {my ($mesg) = @_; print "ERROR: $mesg\n"; exit(1);} sub Debug {my […]
Read more