if ( grep { $commands_run[$_] ne $commands[$_] } 0..$#commands ) { print "Test ---- FAIL\n"; } else { print "Test -----PASS\n"; }