# if this course ID hasn't yet been added to the catalog if (!exists $catalog{$course_id}) { # add course ID and complex description to catalog $catalog{$course_id} = 1; } # add a reference to the catalog entry to the student's course array push @{$students{$student_id}}, \$catalog{$course_id};