while (<>) { my ($coursename, $building, $room, $day, $time, $name) = split /, /, $line; push @coursename, $coursename; push @building, $building; push @room, $room; push @day, $day; push @time, $time; push @name, $name; }