> -Original Message-
> From: Ian [mailto:pcs...@gmail.com]
> Sent: Thursday, August 27, 2009 11:43
> To: beginners@perl.org
> Subject: Printing a hash of hashes of arrays
>
> Pure beginners question.
>
> I'm creating a hash of arrays like this :
>
> $ihash{$3}{$1} = [...@itab];
>
> For
Thank you David, Jim, Uri.
> "I" == Ian writes:
I> Pure beginners question.
I> I'm creating a hash of arrays like this :
I> $ihash{$3}{$1} = [...@itab];
I> For now I was able to get the data using Dumper but I need to create a
I> "pretty" report.
I> How do I loop over this hash/hash of arrays to print i
On 8/27/09 Thu Aug 27, 2009 10:42 AM, "Ian" scribbled:
> Pure beginners question.
>
> I'm creating a hash of arrays like this :
>
> $ihash{$3}{$1} = [...@itab];
>
> For now I was able to get the data using Dumper but I need to create a
> "pretty" report.
>
> How do I loop over this hash/has
Mark Anderson wrote:
>
> Why are you wrapping these in arrays? If you used:
> $tablename{$table} -> {con_name} = $constraint_name;
> $tablename{$table} -> {con_type} = $type;
> $tablename{$table} -> {rem_con_name} = $r_constraint_name;
> $tablename{$table} -> {created_by} = $generated;
In your adding lines you add entries line [ $entry ], which means, make
an array reference (the brackets) which has $entry as the first element
of the array. You then have a hash of hashes of arrays (for at least
some entries). If you meant the arrays, you'll have to add a third
loop to the
> This is from Chapter 9, page 281 slighly
>changed to reflect my values:
>
>for $table ( keys %tablename) {
>print "Table Name: $table \n";
>
>for $items ( keys %{ $tablename{$table} } ) {
>print "\t$items=$tablename{$table}{$items}\n ";
>
>}
>
>print "\n";
That looks re