Agreed... although this is really moving into "hack" territory, my code from here could be extended to:
my $amax; for ($amax=1; exists $Person::{"address_$amax"}; $amax++) {} $Person::addresses = sub{\@_}->( map { no strict 'refs'; ${"Person::address_$_"} } 1..$amax-1 );
In reply to Re^6: How can I access package variables in a dynamic way
by haukex
in thread How can I access package variables in a dynamic way
by bangor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |