sub func { my $arr_ref = shift; my $index = shift; print $arr_ref->[$index]; } my @arr = ("null","eins","zwei","drei"); func(\@arr,2);