mwill66 has asked for the wisdom of the Perl Monks concerning the following question:
I have a database setup to create a webmenu
Each menu can have up to 15 links
I Execute a select * from table and assign it to array
Running debug the follwing Menus are created, I want to use is a while statement that breaks when it hits a variable that is undefined or null in the database.
$VAR1 = "AirDefense"; $VAR2 = 2; $VAR1 = "Mobile-N-Site"; $VAR2 = 4; $VAR1 = "Owl"; $VAR2 = 6; $VAR1 = undef; $VAR2 = 8;using the results above
I defined a variable my $undef = 'undef';
Created a while loop to loop through until undef was found
when i run the loop it never breaks out until it hits all 15 items in the database
while (@MyData[[$y]] ne $undef)Thanks for the help, Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Breaking out of undef/null database reads
by stevieb (Canon) on Aug 05, 2016 at 16:50 UTC | |
|
Re: Breaking out of undef/null database reads
by Marshall (Canon) on Aug 05, 2016 at 17:07 UTC |