my ($x,$y,$z) = @fields; # to simplify matters # Now, your statement can be written as : $students{$x}->[$y] = $z;