maybe something like this then...
my $found = 0;
foreach my $file (@files) {
if( substr($file, 0, 6) eq 'EDI322' ) {
print "Exist\n";
$found++;
}
}
if( ! $found ) {
print "=======The output file does not exist ==========\n";
print LOG "=======The output file does not exist ==========\n";
print Comp_LOG "NS LF Download Process failed\n";
die;
}
Then again if all you want to know if whether @files has no files starting with EDI322, try this:
if( ! grep(/^EDI322/, @files) ) {
print "=======The output file does not exist ==========\n";
print LOG "=======The output file does not exist ==========\n";
print Comp_LOG "NS LF Download Process failed\n";
die;
}
Good luck!