|
|
| Just another Perl shrine | |
| PerlMonks |
Re^3: Getting for() to accept a tied array in one statementby Veltro (Hermit) |
| on Apr 16, 2019 at 13:47 UTC ( [id://1232653]=note: print w/replies, xml ) | Need Help?? |
|
This:
is exactly what you should NOT be doing Read: Tying-Arrays: If someone outside the class tries to dereference the object returned (doubtless thinking it an ARRAY ref), they'll blow up. This just goes to show you that you should respect an object's privacy. FETCH and FETCHSIZE are exactly for that you can: 'respect an object's privacy': Something like this:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||||||||