gube has asked for the wisdom of the Perl Monks concerning the following question:
There are two code snippets pasted below for pragma constant. First program works fine. And second seems not working. Pour your Ideas.
First Program below :
#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; my %hash = ( 'a' => 2 ); use constant A => \%hash; print A->{a};
Second Program below :
#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; my $hash = { 'a' => 2 }; use constant A => $hash; print A->{a};
Gubs
Nice to Breathe with Perl :-) Just try
Back to
Seekers of Perl Wisdom