Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Complex Data Structure Suggestions Wanted

by Roy Johnson (Monsignor)
on Jun 07, 2005 at 11:15 UTC ( [id://464235]=note: print w/replies, xml ) Need Help??


in reply to Complex Data Structure Suggestions Wanted

You don't have to check for existence. You can just use an undefined value as an arrayref and it will autovivify:
foreach my $ItemID (@Data){ push @{$$HashRef{$ItemID}}, $DataSource; # The usual preferred notation is # push @{$HashRef->{$ItemID}}, $DataSource; }

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Complex Data Structure Suggestions Wanted
by Ninthwave (Chaplain) on Jun 07, 2005 at 12:19 UTC

    Thank you, I prefer the preferred notation nice to agree with the masses for a change.

    "No matter where you go, there you are." BB

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-24 05:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found