•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 456,496 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,742 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 1170 | Replies: 2
![]() |
•
•
Join Date: Sep 2007
Location: Near Arctic Circle
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 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]);}
"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]);}
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
•
•
•
•
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]);}
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?
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- C++: compile error "subscripted value is neither array nor pointer" (C++)
- my program is compiled.but on run that i have message "Exception in thread "main" jav (Java)
- google "keyword" question (Search Engine Optimization)
- "Safe array" assignment (C++)
- Stripping the last element off an array (Perl)
Other Threads in the Perl Forum
- Previous Thread: Converting date problem ( I have spent hours trying to fix it)
- Next Thread: Perl code


Linear Mode