in reply to Re: Iterating over *any* thing in Perl
in thread Iterating over *any* thing in Perl
Some people use hashrefs or arrayrefs for their objects, and stuff all the attributes in the things the references point to (and those same people will vote '++' for if someone posts a coding guideline saying "Don't use global variables"). The advantage is that you can access the attributes all the time, from everywhere - the same advance as putting all your variables in main:: gives you.
What would you recommend should be done instead?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Iterating over *any* thing in Perl
by adrianh (Chancellor) on Dec 04, 2002 at 01:13 UTC |