Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; no strict "refs"; use CGI qw/:standard/; my (@compare, %other0, @catnames); %other0 = ( 'cat0'=>'3', 'cat1'=>'3' ); @compare = ('testone', 'testtwo'); @catnames = ('other0','other1'); print "this one works: $other0{'cat1'}\n"; print "problem here: ${$catnames[0]}{'cat1'}\n $catnames[0]->{'cat1'}" +;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Referencing a hash
by broquaint (Abbot) on Jul 07, 2003 at 16:26 UTC | |
|
Re: Referencing a hash
by gellyfish (Monsignor) on Jul 07, 2003 at 16:34 UTC | |
|
Re: Referencing a hash
by hardburn (Abbot) on Jul 07, 2003 at 16:24 UTC | |
|
Re: Referencing a hash
by bobn (Chaplain) on Jul 07, 2003 at 19:11 UTC | |
|
Re: Referencing a hash
by Anonymous Monk on Jul 07, 2003 at 20:13 UTC |