Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Multidimensional Hash implementation/usage

by salva (Canon)
on Sep 17, 2007 at 08:44 UTC ( [id://639357]=note: print w/replies, xml ) Need Help??


in reply to Re: Multidimensional Hash implementation/usage
in thread Multidimensional Hash implementation/usage

The second possibility is to use a separator to join the indexes. Be sure that the separator doesn't occur in the indexes:
my $idx = substr $Fld57, 3, 5; $CNT{$idx . $Fld1 . $Fld15}++; $COST{$idx . $Fld1 . $Fld15} += $Fld14;

Actually, Perl offers some syntactic sugar just for that:

$foo{$a, $b, $c} is equivalent to $foo{join($;, $a, $b, $c)}

It is documented in perlvar.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://639357]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-28 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found