Now that you've got it working, here's a more fundamental question:
Why are you bothering with the regex in the first place? Each $file in @files must already begin with "cold" because that's what you've globbed for. So in your code, the regex pattern always matches and the system() command will never run.
You might mean something like this instead:
chdir 'D:\COLD\DULS' or die "Can't chdir: $!";
my @files = glob ('cold*');
if (scalar @files)
{
foreach my $file (@files)
{
print CBDOWNLOAD "Cold Backup file exists for DULS for $FileName.\
+n"
...
}
}
else
{
system ('awtrap -h RLGH -f DULS "DULSVASG001: Unable to download th
+e file."');
}
Unless I'm misunderstanding your intent, which is perfectly possible...
buckaduck
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.