package secondPakage; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @ISA = qw(Exporter); @EXPORT = qw( &WriteLOG ); @EXPORT_OK = qw(); %EXPORT_TAGS = ( ); our $LOGFile= ""; sub WriteLOG { my ($msg) = @_; my $ltime=localtime; $ltime=~s/\s/_/g; $ltime=~s/_+/_/g; $ltime=~s/^_|_$//; open my $lFD, '>>', "$LOGFile" or die "Unable to open LOG file |$LOGFile| for logging...$!"; printf $lFD "\n=== __FILE__ === $ltime -> $msg\n"; print "\n=== __FILE__ === $ltime -> $msg\n"; close($lFD); } 1;