Your question, your audience. Choose who sees your identity—and your question—with question security.
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; #$running_under_some_shell
use strict;
use warnings;
use File::Find ();
# Set the variable $File::Find::dont_use_nlink if you're using AFS,
# since AFS cheats.
# for the convenience of &wanted calls, including -eval statements:
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;
sub wanted {
#my ($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_);
if ($name =~ /^\/opt\/lampp\/htdocs\/some\/folder\z/s or
$name =~ /^\/opt\/lampp\/htdocs\/another\/folder\z/s) {
$prune = 1
} elsif ($name =~ /\.(?:pl|txt|php|html|xml|js)$/) {
print "$name\n";
}
}
# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '/opt/lampp/htdocs');
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
No. File::Find does not support ssh (then again, neither does find directly). It may be possible to write something in perl to ssh and find but that would likely be very complicated. If doing find over ssh, I would either just use find or write a (some?) perl script(s) and put them on the remote boxes (if not a shared fs) and execute them over ssh (rather than find).