 |
|
Home:
Perl Programming Help:
Advanced:
Re: [Stormdev] Why does my array appear to be out of scope?:
Edit Log
|
|

FishMonger
Veteran
May 8, 2009, 2:57 PM
Views: 1219
|
|
Re: [Stormdev] Why does my array appear to be out of scope?
|
|
|
I'm unable to duplicate your problem, but I see another issue. Do you see it?
[root@fc4dev ~]# cat stormdev.pl #!/usr/bin/perl use strict; use warnings; my @TimeZoneRegions = ( "Eastern Time Zone", "Central Time Zone", "Mountain Time Zone", "Pacific Time Zone", "Alaska Time Zone", "Hawaii Time Zone", ); my $HTML = htmlTimeZonePopdown(); print $HTML; sub htmlTimeZonePopdown { my $default = shift; my $html = ""; $default = 0 if ($default eq ""); foreach my $offset (0..scalar(@TimeZoneRegions)-1) { my $selected = ($offset == $default) ? "selected" : ""; $html .= qq~ <option value="$offset" $selected>$TimeZoneRegions[$offset]</option>\n ~; } return $html; } [root@fc4dev ~]# ./stormdev.pl Use of uninitialized value in string eq at ./stormdev.pl line 23. <option value="0" selected>Eastern Time Zone</option> <option value="1" >Central Time Zone</option> <option value="2" >Mountain Time Zone</option> <option value="3" >Pacific Time Zone</option> <option value="4" >Alaska Time Zone</option> <option value="5" >Hawaii Time Zone</option> [edit adjusted a little error on my part]
(This post was edited by FishMonger on May 8, 2009, 3:02 PM)
|
|
|
Edit Log:
|
|
Post edited by FishMonger
(Veteran) on May 8, 2009, 3:01 PM
|
|
Post edited by FishMonger
(Veteran) on May 8, 2009, 3:02 PM
|
|
Post edited by FishMonger
(Veteran) on May 8, 2009, 3:02 PM
|
|
|  |