For now i have to create another bash script and call that script from this perl script. If i embedded directly above line in the perl it will failed. This is the perl script:
]#!/usr/bin/perl
#Calling the bash script
`/script/bperror14 > /var/tmp/errorout`;
#
open FILE, "/var/tmp/errorout" or die $!;
chomp($hostname=`uname -n`);
chomp($date=`date`);
$count=0;
#
while (<FILE>)
{
($code,$client,$policy,$sched) = split(/ /,$_);
{
mailx -s "Client $client : $hostname Code $code" mymail\@company.com`;
}
}
close(FILE);
Can someone tell me how to directly put those bash line in perl?
BTW, i got below message when i put use Getopt::EvaP;
Can't locate Getopt/EvaP.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at ./filter_script line 6.
BEGIN failed--compilation aborted at ./filter_script line 6.
---------- Post updated 12-04-10 at 12:10 PM ---------- Previous update was 12-03-10 at 01:04 PM ----------
yes , u can use the system command to include your script in perl code.
otherewise try to grep EvaP.pm and if found .
Add the path to the @inc using push command .