Hi All,
I'm trying to print a file name(s) if it matches $query... which is the
basename. I think I can do this w/ a regex? This is the line I'm having
trouble with.
print "$_\n" if (/$query.\w*/ eq $_);
If I'm understanding Learning Perl correctly... the dot ( . ) is a wildcard
and will match any character including the dot, which is what I'm trying to
do. Then match any other character(s) ... so I used the \w+ Can someone
pls explain what I'm doing wrong.
Thanks!!
__BEGIN__
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
my $query = "30700";
# my $string = File::Find::Name;
find(\&wanted, 'w:/html/msds');
sub wanted {
return if ($_ =~ /^\./);
print "$_\n" if (/$query.\w+/ eq $_);
}
__END__
Brian Volk
HP Products
317.298.9950 x1245
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]