in reply to Re^5: Pointers and References
in thread Pointers and References
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Pointers and References
by LanX (Saint) on Nov 24, 2020 at 19:52 UTC | |
by bliako (Abbot) on Nov 24, 2020 at 20:38 UTC | |
by AnomalousMonk (Archbishop) on Nov 24, 2020 at 22:18 UTC | |
by LanX (Saint) on Nov 25, 2020 at 13:55 UTC | |
by bliako (Abbot) on Nov 25, 2020 at 16:08 UTC | |
by Leudwinus (Scribe) on Nov 25, 2020 at 15:33 UTC | |
by LanX (Saint) on Nov 25, 2020 at 16:14 UTC | |
by AnomalousMonk (Archbishop) on Nov 25, 2020 at 20:55 UTC | |
by LanX (Saint) on Nov 25, 2020 at 21:21 UTC | |
|
Re^7: Pointers and References
by AnomalousMonk (Archbishop) on Nov 24, 2020 at 20:13 UTC | |
by Leudwinus (Scribe) on Nov 25, 2020 at 15:37 UTC | |
by bliako (Abbot) on Nov 24, 2020 at 20:44 UTC |