Effective Perl Programming: Writing Better Programs with Perl has this to say about the issue:
It's not necessarily bad programming style to take advantage of Perl's independent namespaces by giving two different kinds of variables the same name. Sometimes it even seems like the sensible thing to do:
@who = grep { /\bjoebloe\b/ } `who`;@who contains output from who command, one line per element. foreach $who (@who) { # ... do something with $who }Iterate over each line of output using variable $who.
--
Allolex
In reply to Re: Confusing variable names
by allolex
in thread Confusing variable names
by toma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |