more useful options | |
PerlMonks |
Re^6: Pointers and Referencesby bliako (Monsignor) |
on Nov 24, 2020 at 19:33 UTC ( [id://11124154]=note: print w/replies, xml ) | Need Help?? |
Thanks for pointing this out LanX Perhaps that's the reason I return a (array)ref: I don't want to say list! Because when I think I grasped the distinction list vs array, something proves me wrong again. But hey when in Perl speak Perl (even if some/quite-a-few publications use the terms interchangebly). I would prefer anonymous, readonly (fixed-size) array of readonly (lest they be references) items. But here is a quick question: you can't modify a list item in say a foreach loop foreach my $x (1,2,3){ $x = 42 } (Modification of a read-only value attempted) but in the parameter list to a sub you can: $_[0] = 12 (as jcb demonstrated earlier). bw, bliako
In Section
Seekers of Perl Wisdom
|
|