in reply to multi-dimensional hash
That's fine, but it is a Hash of Hash (HoH), not a Hash of Array (HoA). You should perhaps take a look at Data::Dumper.
use strict; use warnings; use Data::Dumper; my $rboc = "SA"; my $telco = "0009"; my %HoH; my %MultiHash; $HoH{$rboc}{$telco} ++; $MultiHash{$rboc, $telco} ++; print Dumper (\%HoH); print Dumper (\%MultiHash);
Prints:
$VAR1 = { 'SA' => { '0009' => 1 } }; $VAR1 = { 'SA0009' => 1 };
Note that there is a hidden character in the 'SA0009' string!
Update: added second method.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: multi-dimensional hash
by Anonymous Monk on Nov 02, 2005 at 21:09 UTC |