my @array1 = qw(one two three); my @array2 = qw(onetwo three); if ( do{ local $" = ''; "@array1" eq "@array2"} ) { print 'They are the same', $/; # no, they are NOT }