Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
normally, I would extract the values in classic camel fashion:my %whatever = ( 'a' => [1,2,3,4], 'b' => [5,6,7,8], );
but in this case I'm writing a rule action for the excellent module Parse::RecDescent, so its in another namespace, and must be fully qualified. I tried doingmy $extract = $whatever{'a'}[0]; #should = 1
andmy $extract = $::whatever{'a'}[0]; #should = 1
as well as various attempts to play with references, but all to no avail. RecDescent always complains that it must be fully qualified, or I get an undef returned. Anybody experienced this ? Or better yet, know the answer?my $extract = $main::whatever{'a'}[0]; #should = 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hashes of arrays in another name space
by TGI (Parson) on Jan 11, 2001 at 05:32 UTC | |
|
Re: hashes of arrays in another name space
by merlyn (Sage) on Jan 11, 2001 at 03:25 UTC | |
by Anonymous Monk on Jan 11, 2001 at 21:13 UTC |