print "\@D is not the same as \@E\n" unless check_same( \@D, \@E ); print "\@D is the same as \@F\n" if check_same( \@D, \@F ); #### sub check_same { my ( $ref1, $ref2 ) = @_; die "Bad args passed to check_array\n" unless ( ref( $ref1 ) eq 'ARRAY' and ref( $ref2 ) eq 'ARRAY' ); return 0 if @$ref1 != @$ref2; for my $i ( 0 .. $#$ref1 ) { return 0 if $$ref1[$i] ne $$ref2[$i]; } return 1; }