in reply to File check w/no files

Heh, sometimes it seems Perl offers a few too many choices.

To expand a bit on what my parsimonious brother chip has stated, I'd probably structure it like this:

my @files = glob '*.cold'; # you are using strict, no? if (scalar(@files) == 0) { print "Nothing matched\n"; } else { foreach (@files) { if (/^cold/) { print CBDOWNLOAD "Cold Backup file exists for DULS for $Fi +leName.\n" } else { system ('awtrap -h RLGH -f DULS "DULSVASG001: Unable to d +ownload the +file."'); } } }

HTH

Replies are listed 'Best First'.
Re: Re: File check w/no files
by cybermack72 (Novice) on Nov 29, 2001 at 21:01 UTC
    Thanx HTH, I'd been bangin my head on this one, til I saw the white meat. It worked perfectly. Brutha's in Perl.....