use strict; use warnings; my @run; for my $element (@run) { my ($run_cmd, $chdir_cmd) = split ';', $element, 2; ch_dir ($chdir_cmd, $patch, '0'); system ($run_cmd); if ($run_cmd =~ /check.pl/) { next if $? == 2; } elsif ($? == 0) { next; } print "Command Failed: While Executing $run_cmd$!\n"; $err = 1; }