in reply to Re: how to make wildcard work in if (-e *..)
in thread how to make wildcard work in if (-e *..)
If you have seven files, every 7th number will be missing, because the glob has run out, and has returned undef, and is resetting.foreach $n (1..50) { print "$n: "; print "yes" if -e <*>; print "\n"; }
This is better, as it uses glob in a list context:
print "Found textfile!" if () = <$dir/*.txt>;
-- Randal L. Schwartz, Perl hacker
|
|---|