in reply to Why -M doesn't work?

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){ #... }

Replies are listed 'Best First'.
Re^2: Why -M doesn't work?
by xingjin3131 (Novice) on Feb 15, 2008 at 15:41 UTC
    Thanks a lot for your information. I did not know glob before. ^ _ ^