romandas has asked for the wisdom of the Perl Monks concerning the following question:
#!/perl/bin/perl use warnings; use strict; use File::Find; foreach my $computer (<>) { chomp($computer); print($computer, "\n"); system("net", "use", "z:", '\\\\' . $computer . '\\' . 'c$'); find(\&wanted, ('z:')); system("net", "use", "z:", "/DELETE"); } sub wanted { if ((-f $File::Find::name) && ($File::Find::name =~ m/log$/i)) { print($File::Find::name); if (open(FILE, $File::Find::name)) { print("\topened\n"); close(FILE); } else { warn("Cannot open $File::Find::name: $!\n"); print("\tfailed\n"); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with mapping windows shares and File::Find
by Corion (Patriarch) on Mar 11, 2008 at 15:31 UTC | |
by romandas (Pilgrim) on Mar 11, 2008 at 15:40 UTC |