P is for Practical | |
PerlMonks |
Re^4: Using Constants in Perlby the_slycer (Chaplain) |
on Mar 01, 2006 at 01:15 UTC ( [id://533553]=note: print w/replies, xml ) | Need Help?? |
I was pretty sure you could declare a hash with use constant.. or well, a hash reference anyways:
Then use it like you would any hashref ie: print HASH_REF->{constant_key} or foreach my $key (keys %{ &HASH_REF }) { ... } or the even weirder: foreach my $key (keys %{ HASH_REF() }) { ... }
In Section
Seekers of Perl Wisdom
|
|