in reply to Comparing Arrays

Your join method has a bug. It considers the following 2 lists to be identical:
@a1=qw(3 5 7); @a2=qw(357);
It is because your join makes both of those into the string "357" for comparison.