Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: 2d arrays in Perl?

by perigeeV (Hermit)
on Aug 21, 2002 at 09:28 UTC ( #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? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2022-12-07 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?