In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] writes:
>I am getting these errors... any ideas?
You are somewhat further away from success than simply eliminating the errors.
Here's a start.
>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 .
Generally perl reports the line number of the error. Did you paste these
correctly?
>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/sbin:/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;
You called the hash %mailman, not %mail.
>print %mailman <<EO_SIG
Semicolon missing. Read about the << operator with
perldoc perlop.
>EDM foreign tapes were found now attempting to label
>EO_SIG;
Remove semicolon.
You appear to have confused this with another mail sending module.
According to the documentation, Mail::Sendmail sets the message
body with an entry in the hash, not printing to some filehandle
(and if it were, the filehandle couldn't be a hash). Besides,
you already sent the mail by calling the sendmail() function.
I think you are confusing it with Mail::Send, which IMHO is a
better module anyway.
>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.
May I also suggest investigating the value of indentation.
--
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>