You could be very simplistic about it and use 'P' (a module in CPAN,
also, after fixing some syntax errors in your VAR statement):
> 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]}}
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...
BTW -- what was "$hash" supposed to be in your 2nd line of your original code?