Having to know how many rows and columns there are in a multi-dimensioned array can become tedious. Unless strictly necessary you can avoid it having to code it into your program...
use strict; sub dataSetup { return ( [ qw|a b c d| ] , [ qw|a b c d| ] , [ qw|a b c d| ] ) ; } sub main { my @multi = dataSetup(); foreach my $row (@multi){ foreach(@$row){ print qq|$_\n|; } } } #---- &main;
Celebrate Intellectual Diversity
In reply to Re: Variable in a foreach loop
by InfiniteSilence
in thread Variable in a foreach loop
by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |