S
smartins68
I have a Perl code and I am receiving the error below and I am strugling
with that. Can anybody help me that? I am a new perl person:
$ ./CheckProvActivity.pl 2004 06 07
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 22.
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 22.
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 24.
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 24.
Cannot open /apps/log/opwv/provisioning/Proxy_07.log: No such file or
directory
This is part of my code:
#!/usr/local/bin/perl -w
if (($ARGV[0] eq "") && ($ARGV[1] eq "") && ($ARGV[2] eq ""))
{
($yday,$ymonth,$yyear) = (localtime(time() - ( 24 * 60 * 60 )))[3,4,5];
$WDay= sprintf("%02d",$yday);
$wMon= sprintf("%02d",$ymonth);
$WYear= sprintf("%04d",$yyear+1900);
}
elsif (($ARGV[2] eq "") && ($ARGV[0] ne ""))
{
print "\n\nThis script expects the following arguments YYYY MM DD.
E.g:\n\n";
print " %CheckProvActivity 2004 06 07\n\n\n";
exit 1;
}
$WYear = $ARGV[0];
$wMon = $ARGV[1];
$WDay = $ARGV[2];
$infileloc="/apps/log/opwv/provisioning";
$filename = "$infileloc/Proxy_$WYear_$wMon_$WDay.log";
$outputloc="/opt/opwv/smartins/";
$outfile="$outputloc/ProvActivity_$WYear_$wMon_$WDay.txt";
unlink $outfile;
open(fileIN, $filename) or die ("Cannot open $filename: $!\n");
Thanks,
smartins68
with that. Can anybody help me that? I am a new perl person:
$ ./CheckProvActivity.pl 2004 06 07
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 22.
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 22.
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 24.
Use of uninitialized value in concatenation (.) or string at
../CheckProvActivity.pl line 24.
Cannot open /apps/log/opwv/provisioning/Proxy_07.log: No such file or
directory
This is part of my code:
#!/usr/local/bin/perl -w
if (($ARGV[0] eq "") && ($ARGV[1] eq "") && ($ARGV[2] eq ""))
{
($yday,$ymonth,$yyear) = (localtime(time() - ( 24 * 60 * 60 )))[3,4,5];
$WDay= sprintf("%02d",$yday);
$wMon= sprintf("%02d",$ymonth);
$WYear= sprintf("%04d",$yyear+1900);
}
elsif (($ARGV[2] eq "") && ($ARGV[0] ne ""))
{
print "\n\nThis script expects the following arguments YYYY MM DD.
E.g:\n\n";
print " %CheckProvActivity 2004 06 07\n\n\n";
exit 1;
}
$WYear = $ARGV[0];
$wMon = $ARGV[1];
$WDay = $ARGV[2];
$infileloc="/apps/log/opwv/provisioning";
$filename = "$infileloc/Proxy_$WYear_$wMon_$WDay.log";
$outputloc="/opt/opwv/smartins/";
$outfile="$outputloc/ProvActivity_$WYear_$wMon_$WDay.txt";
unlink $outfile;
open(fileIN, $filename) or die ("Cannot open $filename: $!\n");
Thanks,
smartins68