opendir(DULS, 'D:\COLD\DULS'); chdir 'D:\COLD\DULS'; @files = glob ('cold*'); foreach $file (@files) { print CBDOWNLOAD "Cold Backup file exists for DULS for $FileName.\n" if ($file =~ m/^cold/); system ('awtrap -h RLGH -f DULS "DULSVASG001: Unable to download the file."') if ($file !~ m/^cold/); }