![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re^3: foreach doesn't select array elementby AnomalousMonk (Archbishop) |
on May 04, 2009 at 10:31 UTC ( #761692=note: print w/replies, xml ) | Need Help?? |
Shouldn't foreach (@$fldref[3]) {} automatically use the referenced array or spit out a warning about passing a single ref?foreach (see perlsyn) will iterate over the list that you build for it. If you build a list by de-referencing a reference to an array (an array which may have zero or one or more elements) or by simply specifying a single scalar (which may be a reference to an array of zero or more elements), that's your business.
In Section
Seekers of Perl Wisdom
|
|