March 2001
Intermediate to advanced
288 pages
4h 56m
English
That is all well and good for scalars and arrays, but it won't even handle hashes, let alone complex lists of lists. A good way to deal with those is to use the Dumper function in the Data::Dumper module which will let you print out, nicely formatted, anything you give it, no matter how complex:
use Data::Dumper; # set %state from some database or flat file warn Dumper(\%state);
which produces
$VAR1 = {
'WI' => {
'BIRD' => 'Robin',
'NAME' => 'Wisconsin',
'LARGEST_CITY' => 'Milwaukee',
'CAPITAL' => 'Madison',
'FLOWER' => 'Wood Violet'
},
'MS' => {
'BIRD' => 'Mockingbird',
'NAME' => 'Mississippi',
'LARGEST_CITY' => 'Jackson',
'CAPITAL' => 'Jackson',
'FLOWER' => 'Magnolia'
},
[...]
Note that we passed a reference to the ...