Hi,

I have the following code in my program.

use strict;
use warnings;
use diagnostics;
use Time::Local;

my @match_list;
my $days1 = "";
my $days2 = "";
my $day = "";



if ($failtag eq "CompileErr") {

open my $pipe, "-|", "/usr/atria/bin/cleartool", "desc",
"$include_path/$srcfile" or die "could not run cleartool: $!";

while (<$pipe>) {

next unless /created/;

my @rec = split;

push @match_list, substr $rec[1], 0, 9; }
my $NOW=`date "+%d-%b-%Y`;
my $t = @match_list;
$days1 = epoch_days("$NOW");
$days2 = epoch_days("$t");

$day = $days1 - $days2;

if ($day < 15)

{

$failtag = "TestcaseDiff";

}

BEGIN {

my %month_num = do {

my $n = 0;

map(($_, $n++), qw/jan feb mar apr may jun jul aug sep oct nov dec/);

};

sub epoch_days {

my @dmy = split /-/, shift;

$dmy[1] = $month_num{lc $dmy[1]} || 0;

return timelocal(0, 0, 0, @dmy) / (24 * 60 * 60);

}

}

}

When I execute the program I am getting below exception error.

Line 405 in the program points to

"return timelocal(0, 0, 0, @dmy) / (24 * 60 * 60);"

Am I missing anything in code.

----------------------------------------------------------------------------------------------------------------

Uncaught exception from user code:

Day '0' out of range 1..31 at
/CLO/Tests/CTI/Scripts/drivers/lib/regressionDriver.pm line 405

Time::Local::timegm called at /usr/local/lib/perl5/5.8.0/Time/Local.pm line
120

Time::Local::timelocal(0,0,0,0,0) called at
/CLO/Tests/CTI/Scripts/drivers/lib/regressionDriver.pm line 405
----------------------------------------------------------------------------------------------------------------------

-Rajini

Reply via email to