Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: 2d arrays in Perl?

by perigeeV (Hermit)
on Aug 21, 2002 at 09:28 UTC ( [id://191675]=note: print w/replies, xml ) Need Help??


in reply to 2d arrays in Perl?

Only you know your data, but you may also consider a hash of hashes. That way you can use the student name as the hash key:

$pupils{JohnDoe}->{"ClassID"} = "99-A";

With an array anytime you want to manipulate a pupil/set of pupils' attributes you'll have to traverse the array looking for the proper name. With a hash keyed to their name you let Perl do it for you. Of course you had better be sure all the names are unique first.


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found