Hmm.. There seems to be no (obvious to me) way to edit or revise one's initial post here...

In any case, i've yet to really solve this problem, but i've worked around it using a call directly to the underlying OS's find function. i had to open it at a filehandle to get the output back, so system didn't seem workable.

i don't like this because it's quite non-portable (important to me since i'm developing on linux, but this will run on an old solaris box), but.... well, it works.

Here's the find_test.pl code i came up with:

#!/usr/bin/perl -w # This is a poor way to list filenames using all the available # switches for your local 'find' command. It could probably be # better accomplished with File::Find, but i was not able to # make that work. use strict; use Data::Dumper 'Dumper'; # here you can use whatever arguments you like.... open FIND, "find . -name *.html -maxdepth 3 -mindepth 3 |"; # a large number, MAXLINE if you're being conscientous read FIND, my $find_output, 99999; # the find output is returned as one big string, so split it my @files = split(/\n/, $find_output); # dump the raw find output. note that it's all one value, # with \n (newline) in it. print Dumper [$find_output]; # now dump the array.. each 'hit' on it's own position print Dumper [@files]; exit 0;

If anyone has a better way to do this, i'm highly interested!


In reply to Re: find2perl with File::Find and -maxdepth by u914
in thread find2perl with File::Find and -maxdepth by u914

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.