in reply to Re^2: Perl list items
in thread Perl list items
"Part of my point in writing all these different versions of A is to demonstrate that choosing the same name for a scalar and an array is confusing. It is much more readable to have distinct, concise, yet descriptive names."Is it also not a good idea to use the same name for scalar and array in a loop? I tend to do this all the time
UPDATE:lol, what a blunder. I guess I use this construct so much that these names look the same to me (aside from having a different sigil), whereas they really are different.foreach my $item (@items){ ... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl list items
by frozenwithjoy (Priest) on Jul 09, 2012 at 16:17 UTC | |
by robertw (Sexton) on Jul 09, 2012 at 17:57 UTC | |
by davido (Cardinal) on Jul 10, 2012 at 00:34 UTC | |
by robertw (Sexton) on Jul 10, 2012 at 02:27 UTC | |
by davido (Cardinal) on Jul 10, 2012 at 07:03 UTC | |
by aaron_baugher (Curate) on Jul 09, 2012 at 19:24 UTC | |
by AnomalousMonk (Archbishop) on Jul 10, 2012 at 07:51 UTC | |
by Anonymous Monk on Jul 10, 2012 at 08:37 UTC | |
| |
Re^4: Perl list items
by tobyink (Canon) on Jul 09, 2012 at 16:17 UTC |
In Section
Seekers of Perl Wisdom