I'm not very familiar with Perl, yet. I would like to construct a 2d array which will store data about pupils in our school. We have a number of pupils and for each pupil I want to store Name, ClassID, a variable number of CourseCodes.
In C++ I would create a class, because Name and ClassID would be strings and CourseCodes would be a dynamic array of some kind. Should I go OO in Perl, too, or is it possible to do something like:
@thePupils[23]->{"ClassID"} = "99-A";
This would store classID 99-A to the 23:rd pupil in the array.
@courses = @thePupils[23]->{"CourseCodes"};
This should store the 23:rd pupil's all course codes in an array for further processing.
I've tried these lines, but I get different errors. How should I declare the whole array?
jotti