Do you mean use it like this?
#!/usr/bin/perl -w
use strict;
use warnings;
use File::Find;
my @inits;
sub wanted {
if (-l $_ && (readlink("$_") =~ /tomcat/)) {
push @inits, $_ ;
}
}
find(\&wanted, '/etc/rc.d/init.d');
print join("\n", @inits);
I'm not really seeing what I'm gaining (aside from exposure to a very useful module). It seems like overkill, and I can't determine how to prevent it from recursively going into any subdirectories. The $options{'bydepth'} doesn't seem to do that from what I can understand of the docs.