in reply to Using hashref values in constant declarations.
Yes, and yes:
my $hashref; BEGIN { $hashref = { 'ONE' => 1, 'TWO' => 2, 'THREE' => 3, 'FOUR' => 4, }; } use constant HASHREFCONST => [$hashref->{ONE} .. $hashref->{FOUR}];
Altho that is one heck of a strange way to use hashref to set up a constant... what's wrong with use constant FOO => [1 .. 4];?
|
|---|