Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: File::Find Usage with 2 subroutines

by zork42 (Monk)
on Jun 15, 2013 at 08:33 UTC ( #1039086=note: print w/replies, xml ) Need Help??


in reply to Re^2: File::Find Usage with 2 subroutines
in thread File::Find Usage with 2 subroutines

Hello pnaik!
It's well worth reading this: How do I post a question effectively? :)
You should always have "use strict" and "use warning" near the start of your script (except in trivial scripts). They'll save you a lot of time catching bugs at compile time.
  • Comment on Re^3: File::Find Usage with 2 subroutines

Replies are listed 'Best First'.
Re^4: File::Find Usage with 2 subroutines
by zork42 (Monk) on Jun 15, 2013 at 08:47 UTC
    I tried running this:
    use strict; use warnings; use File::Find; sub finda { print "In finda, $File::Find::name\n"; } sub findb { print "In findb, $File::Find::name\n"; } find (\&finda, "/abc/xyz"); find (\&findb, "/pqr");
    and got this result:
    In finda, /abc/xyz # a folder In finda, /abc/xyz/file1 # a file In findb, /pqr # a folder In findb, /pqr/file2 # a file
    This is what you expected (apart from the 2 folders)
    So, as the snippets of code you provided behave as expected, you need to post your code before we can help further.

    Update: I mean: post a minimal script that reproduces your problem.
    (This is all covered in How do I post a question effectively? !)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039086]
help
Chatterbox?
[chacham]: I'm sure this is old, but i just came across it: If you put a million monkeys at a million keyboards, one of them will eventually write a Java program. The rest of them will write Perl programs.
[LanX]: lol
[Corion]: Woo hoo! A new Auralnauts episode!
LanX mean unfair and funny
[LanX]: but most java code looks like from one million monkey using eclipse. ..
[Eily]: ah yes, perl's motto, There Is More Than One Monkey Typing It

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2018-04-23 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?