in reply to Doubt in assigning hash reference values for Constant pragma declaration ?
is evaluated at compilation time, beforeuse constant A => $hash;
has been executed.my $hash = { 'a' => 2 };
Yo can use a BEGIN block to make the assignment at compile time:
Or also:my $hash; BEGIN { $hash = { 'a' => 2 } } use constant A => $hash;
my $hash; use constant A => $hash = {'a' => 2};
In Section
Seekers of Perl Wisdom