THRAK has asked for the wisdom of the Perl Monks concerning the following question:
That dump yields:report_block(\$report_data{$domain}{$provider}); sub report_block { my ($rpt_ref) = shift; print Dumper($rpt_ref); #access elements here! }
But I can't seem to figure out how to access the individual elements. After searching around I've tried the following, but neither of them are what I need.$VAR1 = \{ 'error' => 0, 'total' => 7, 'soft_error' => 0, 'hard_error' => 0, 'ok' => 7 };
Obviously something escapes me here. ;)print $rpt_ref{total}; #Global symbol "%rpt_ref" requires explicit package name... print $rpt_ref->{total}; #Not a HASH reference at...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dereferencing a portion of a hash
by tall_man (Parson) on Feb 18, 2005 at 16:08 UTC | |
by THRAK (Monk) on Feb 18, 2005 at 16:37 UTC | |
by RazorbladeBidet (Friar) on Feb 18, 2005 at 16:50 UTC | |
by THRAK (Monk) on Feb 18, 2005 at 17:12 UTC | |
by RazorbladeBidet (Friar) on Feb 18, 2005 at 17:22 UTC | |
| |
|
Re: Dereferencing a portion of a hash
by Anonymous Monk on Feb 18, 2005 at 16:27 UTC |