Sounds like you need to consider using a Database for this. You would have a table for students, their ID will be the primary key. You will need another table that lists the available subjects, with some unique ID for each one of those. You will need a cross-reference table to join Students with there subjects. It will consist of two fields, one for the Student ID and one for the Subject ID.
From there you will need two similar tables for the entries that links them to the proper subject.
Not using a database on a complex problem like this tends to make your code 700+ lines; using a database on a problem like this tends to make your code MUCH smaller:
A wham! You now have all subjects and entries for student '?' - and they are ordered by the database, not Perl.select students.lname, students.fname, subjects.name, entries.name from students left join subjects on students.id = subjects.student_id left join entries on subjects.id = entries.subject_id where students.id = ? order by students.Sex, students.lname, students.fname
Databases by themselves are beyond the scope of this site, but be sure and read up on DBI.
jeffa
In reply to (jeffa) 5Re: associative array problem
by jeffa
in thread associative array problem
by Gerryjun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |