All, 
 
I am getting these errors... any ideas?
 
Global symbol "%mail" requires explicit package name at foreign_tape_ck.pl 
line.
Bareword "EO_SIG" not allowed while "strict subs" in use at 
foreign_tape_ck.pl .
foreign_tape_ck.pl had compilation errors.
 
Here is my code:
## Set pragmas
use strict;
use Mail::Sendmail;
## Set and edit variables
my $foreigntapes="/usr/local/log/foreign_tapes.log";
delete $ENV{'IFS'};
local $ENV{'PATH'} = "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbi
n:/bin:/sbin";
#print $ENV{'PATH'},"\n";
## Traverse through array and play with data
open (OUT, ">>$foreigntapes") || die "could not open file:$!";
my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`;
print OUT "@ftapes";
if ( -s OUT ) {
my %mailman = ( From => 'EDM01 <[EMAIL PROTECTED]>',
To => 'Derek Smith <[EMAIL PROTECTED]>',
Subject => "Foreign Tapes Found" );
sendmail (%mail) or die $Mail::Sendmail::error;
print %mailman <<EO_SIG
EDM foreign tapes were found now attempting to label
EO_SIG;
foreach $_ (@ftapes) {
print $_;
#`evmlabel -l st_9840_acs_0 -t 9840S -b$_`
}
close (OUT);
}
My goal is to send an email if the file is greater than 0 bytes after the
system app command is run and directed to the log file.
thank you!

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams

Reply via email to