|
Posted by Reinhard Pagitsch on October 27, 2005, 12:52 pm
Please log in for more thread options
BartlebyScrivener wrote:
> I am trying to learn Perl using the latest ActiveState on a Windows XP
> machine.
>
> Most of the examples I find for using modules are made for Linux users.
> So when I set out to learn find2perl or File::Find the scripts usually
> don't work because of pathname problems, (or so I assume).
>
> Could someone please supply a file::find example for a windows xp
> machine?
>
> For instance, my drives are usually partitioned with data on d:\. How
> would I search all files on d: drive for any file containing the string
> "perl amateur"
>
> Thank you for any help.
More detailed error messages would be helpfull to reproduce the problem.
But it is similar the same as on UNIX/Linux, except that you have to use
/ instead of \.
eg:
my $dir = "D:/test/data";
sub wanted
{
if(!-d $File::Find::name)
{
print $File::Find::name . "\n";
}
}
find(\&wanted, $dir);
--
regards,
Reinhard
|