in reply to problem : return an array list

This is one of the interesting things in perl. When I 1st started with perl I was weirded out by this quirk. Pretty much you need to pass by reference, then deference it.

return @ary1, @ary2, @ary3; becomes: return \@ary1, \@ary2, \@ary3.

Dereference:

my @aryref = &retary; print ${$aryref[0]}[0]; #print 1st element of 1st array


As an alternate method to return non order dependent data consider using a hash:
my %hash; $hash{ary1} = @ary1; $hash{ary2} = @ary2; $hash{ary3} = @ary3;
I've started return and receiving hashes in my subrou.. ahem, methods, as you now dont have to worry about the order in which you call them..

As a slight aside Data::Dumper is invaluable when you get the dereferencing blues with complex data structures:

#!/usr/bin/perl -w use strict; use Data::Dumper; my @aoh; $aoh[0] = { key => 'value'}; print Dumper(@aoh);
HTH's!