Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: File::Find in a loop

by tobyink (Abbot)
on Apr 29, 2013 at 00:40 UTC ( #1031132=note: print w/ replies, xml ) Need Help??


in reply to File::Find in a loop

I have no idea why so many people actually go to the trouble of creating an actual sub in their code called "wanted". Pass a coderef...

use strict; use warnings; use File::Find; my @dir = qw( N:/TMP N:/TMP_2 ); for my $dir (@dir) { find(sub { print "[$dir] $File::Find::dir $File::Find::name\n"; }, $dir); }
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name


Comment on Re: File::Find in a loop
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2015-07-29 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls