Once you call 'return' in a subroutine the subroutine stops executing and control is returned to the caller. Therefore, no code after the first return is ever executed. Also, well you call the sub with the first array as an argument, it runs the get_pairs() function right then. It doesn't wait around for you to give it the other 4 arrays.
It looks to me like you have a few very odd ideas about how functions work in perl. Might I suggests some reading: perlsub
I'd suggest looking into information on
- Using arrays as arguments to functions
- Returning values from functions
- Returning arrays from functions
-caedes