Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: aborting File::Find::find

by petdance (Parson)
on Nov 19, 2006 at 01:36 UTC ( [id://584909]=note: print w/replies, xml ) Need Help??


in reply to aborting File::Find::find

Use File::Next instead. It's an iterator, so you control how and when the iterators is called.
my $iter = File::Next->new( $dir ); my $done = 0; while ( !$done && my $file = $iter->() ) { # do stuff }
You can blow out of that loop whenever you want, with either a last; or a $done = 1;. The key is that it's YOU controlling the iteration, not File::Find and not some funky control package variables like $File::Find::prune.

xoxo,
Andy

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found