Passing two or more arrays to a Perl subroutine
问题 I am having trouble passing and reading arguments inside subroutine which is expected to have two arrays. sub two_array_sum { # two_array_sum ( (1 2 3 4), (2, 4, 0, 1) ) -> (3, 6, 3, 5) # I would like to use parameters @a and @b as simply as possible } # I would like to call two_array_sum here and pass two arrays, @c and @d I have seen and tried several examples from the web, but none of them worked for me. 回答1: There are two ways you can do this: by prototype by reference But before I