sub secondRoutine { # there's nothing wrong here, but $aref (and $href) are shorter and # convey the same meaning #my ($array1_ref, $array2_ref, $array3_ref) = @_; my ($aref1, $aref2, $aref3) = @_; # - use references directly # - added newlines for clearer output # - brackets are unnecessary (just a style choice, no actual impact) #print ("Test first value in array1: $$array1[0]"); #print ("Test third value in array2: $$array2[2]"); #print ("Test fifth value in array3: $$array3[4]"); print "Test first value in array1: ", $aref1->[0], "\n"; print "Test third value in array2: ", $aref2->[2], "\n"; print "Test fifth value in array3: ", $aref3->[4], "\n"; }