in reply to Is it possible to return two array by the same subroutine?

Since subroutines return lists, and arrays are flattened in list context, your arrays are probably being flattened into a single list. What you probably want is to return 2 array references, so the 2 arrays remain distinct 'objects' e.g
sub foo { my @x = 1 .. 5; my @y = reverse 1 .. 5; return \@x, \@y; } my($ar1, $ar2) = foo(); print "array 1 - @$ar1\n"; print "array 2 - @$ar2\n"; __output__ array 1 - 1 2 3 4 5 array 2 - 5 4 3 2 1
See. the likes of tye's References quick reference and japhy's "list" is a four letter word for more info on references and contexts.
HTH

_________
broquaint