http://qs1969.pair.com?node_id=191675


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.