You can, of course, return lists from subs:
sub foo {
my @list1 = ( 1, 2, 3 );
my @list2 = ( 4, 5 );
return ( @list1, @list2 );
}
my @list = foo();
print @list; # 12345
But it is not the recommended way to do that unless you know what you are doing.
While th...