perl -e ' sub test { my @array = qw{ fish, chicken, pork }; return @array,1; } # $ret_val gets the value 1; $ret_val = test(); # @ret_val get each item in @array and the last # index in @ret_val is 1 @ret_val = test(); print $ret_val . "\n"; print @ret_val . "\n"; for ( @ret_val ) { print $_ . "\n" }; ' 1 4 fish, chicken, pork 1