0

I keep getting the following errors everytime I call my get_prevday subroutine which is at the bottom. I have initialized all the variables in the program that I can think of. Please help!!:

"Use of uninitialized value in array element at
Thickness_vs5.cgi line 542. <FILE> line 71. "


"Use of uninitialized value in array element at
Thickness_vs5.cgi line 543. <FILE> line 71. "







.
.
my @date, $m, $md, $y, $epochtime;
$date[$x]= get_prevday($date[$x]);
.
.
.
###################Subroutines ###################
LINE 542 ->sub get_prevday { $date[$x] = shift || return(0);
LINE 543 ->($m,$md,$y) = $date[$x] =~ m|(\d+)/(\d+)/(\d+)|;
$epochtime = timelocal_nocheck(0, 0, 0, $md-1, $m-1, $y);
return strftime("%m/%d/20%y",0,0,0,(localtime($epochtime))[3,4,5]);}

Edited by happygeek: fixed fomatting

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by KevinADC
0

I keep getting the following errors everytime I call my "get_prevday" subroutine which is at the bottom. I have initialized all the variables in the program that I can think of. Please help!!:

"Use of uninitialized value in array element at
Thickness_vs5.cgi line 542. <FILE> line 71. "

"Use of uninitialized value in array element at
Thickness_vs5.cgi line 543. <FILE> line 71. "


.
.
my @date, $m, $md, $y, $epochtime;
$date[$x]= get_prevday($date[$x]);
.
.
.
###################Subroutines ###################
LINE 542 ->sub get_prevday { $date[$x] = shift || return(0);
LINE 543 ->($m,$md,$y) = $date[$x] =~ m|(\d+)/(\d+)/(\d+)|;
    $epochtime = timelocal_nocheck(0, 0, 0, $md-1, $m-1, $y);
                    return strftime("%m/%d/20%y",0,0,0,(localtime($epochtime))[3,4,5]);}

end quote.

It looks to me like the culprit might be line 71 in whatever file / data you are reading. Have you checked that source for maybe a missing data field?

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.