in reply to A moment with Perl
If you haven't done so already, take a look at perldata.
Also, (again, if this is new to you), look into using Data::Dumper. It's a fantastic, simple way of verifying exactly what a given data structure looks like.
For example:
use strict; use warnings; use Data::Dumper; my $pdata = { 'red' => [ 'abc', 'def', 'ghi' ], 'blue' => { '123' => '456', 'xxx' => 'yyy' }, }; print "Dump of pdata = ", Dumper($pdata), "\n";
which prints:
Dump of pdata = $VAR1 = { 'blue' => { '123' => '456', 'xxx' => 'yyy' }, 'red' => [ 'abc', 'def', 'ghi' ] };
And that tells you that you have a hash ($pdata) containing two keys, 'blue' and 'red', where 'blue' is a pointer to a hash containing two keys and two values, and 'red' is a pointer to an array containing 3 values.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A moment with Perl
by Lady_Aleena (Priest) on Oct 07, 2007 at 14:17 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |