dpenny has asked for the wisdom of the Perl Monks concerning the following question:

I've hunted your site and others, but I cannot find examples of finding an arbitrary directory given a different arbitrary starting point. This is my first post to PerlMonks. Thanks

edited: Fri Aug 2 02:38:51 2002 by jeffa - title change (was: how to)

Replies are listed 'Best First'.
(jeffa) Re: How to find an arbitrary directory
by jeffa (Bishop) on Aug 02, 2002 at 02:42 UTC
    Try the built-in File::Find or the new File::Find::Rule:
    use strict; use File::Find::Rule; my ($target,$source) = @ARGV; for (find(directory => name => $target, in => $source)) { print "$_\n"; }
    or as a one-liner:
    perl -MFile::Find::Rule -le "print for find(directory => name => shift +, in => shift)" mp3 ~
    Oh, and welcome to the Monastery. :)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)