Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: regarding File::Find

by inman (Curate)
on Nov 17, 2006 at 12:59 UTC ( #584720=note: print w/ replies, xml ) Need Help??


in reply to regarding File::Find

The following code uses the list as a buffer. The wanted method adds the value to the buffer and only saves the buffer if it has a reached a certain length.
#! /usr/bin/perl -w use strict; use Data::Dumper; use File::Find; my @search_result; find (\&wanted,"."); save_data(); sub wanted { return unless /\.pl$/i; push @search_result,$File::Find::name; if (@search_result == 10) { # save buffer and empty if 10 results save_data(@search_result); @search_result = (); } } # stubbed! sub save_data { print join(',',@search_result),"\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://584720]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2016-06-30 21:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (403 votes). Check out past polls.