open (FILE, "student.data"); while (defined ($line = )) { if ($line =~ /^(.*)!(.*)!(.*)!(.*)$/) { $id{$1} = $1; #id's $student{$1} = $2; $major{$1} = $3; $status{$1} = $4; } } close (FILE);