my $cmd = "rsh $file"; # or whatever my $output = qx/$cmd/; # qx// is the same as `` my $rc = $?; # $? is a special Perl variable if ( $rc ) { print STDERR "No Match\n"; # you just want to print and continue, right? }