Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Calling a hash through an array value

by dragonchild (Archbishop)
on Jan 08, 2003 at 21:17 UTC ( #225358=note: print w/replies, xml ) Need Help??

in reply to Calling a hash through an array value

Bad c! No cookie! We do not use symbolic references.

Instead, make a hash of hashes (or HoH). So, do something like:

my %asn; for my $i (@asnValues) { my @asnParams = split / /, $i; my $keyName = $asnParams[0]; $asn{$keyName}{risk} = $queueNsp[2]; }
Treat it as you would a 2-D array in C or BASIC or JAVA or any other language. The only difference is that you don't have to pre-declare it. Perl does that for you on the fly. (If you don't need or want to know how, then just assume it will work and go about your business.)

We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: Calling a hash through an array value
by FamousLongAgo (Friar) on Jan 08, 2003 at 22:25 UTC
    Well, of course we can use symbolic references - when it's the right thing to do.

    But here it's not.

    Here is a detailed explanation (Dominus article) for why dragonchild bit your head off.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2023-04-01 14:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found