in reply to print hash elements
But if you are wanting an introduction to references, you might look at the book "Intermediate Perl" by Schwartz, foy & Phoenix (on amazon), Chapter 4, "Introduction to References". It's very important to understand what you are doing in the code if you want to print it out...> perl -we' use strict; use P; my $VAR1 = { "A1" => { "val1" => [23], "val2" => [42], "val3" => [15], + "val4" => [10] } ,"B1" => { "val1" => [13], "val2" => [22], "val3" = +> [25], "val4" => [11] }}; P "-----------\nvar=%s", $VAR1;' ----------- var={A1=>{val1=>[23], val2=>[42], val3=>[15], val4=>[10]}, B1=>{val1=> +[13], val2=>[22], val3=>[25], val4=>[11]}}
BTW -- what was "$hash" supposed to be in your 2nd line of your original code?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: print hash elements
by stevieb (Canon) on Sep 13, 2016 at 14:19 UTC |