And this is why I almost always use glob instead of opendir. It's rare that I want filenames without the context of the directory, which is what opendir does. Generally, I want the full relative or absolute name, as glob gives me. Also, the "wildcards" that glob uses make more sense to me in that context (your regexp isn't working anyway).
my @myfile = glob ('d:/Log/tmp/*.tmp'); foreach my $file (@myfile){ #... }
In reply to Re: Why -M doesn't work?
by Tanktalus
in thread Why -M doesn't work?
by xingjin3131
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |