Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by pnaik (Initiate)
on Jun 17, 2013 at 09:36 UTC ( #1039315=note: print w/replies, xml ) Need Help??


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

I found the issue, I showed wrong sequence of 'find' calls, actually the find was getting called recursively, and in that it retains the context of parent call probably. I was thinking it to be a re-entrant function, but looks like its not. This is how it looked :

sub finda { print "In finda, $File:Find:name\n"; find (\&findb, "/pqr"); } sub findb { print "In findb, $File:Find:name\n"; } find (\&finda, "/abc/xyz");

Anyways, now I have changed the script to have the recursive nature removed, so that the two calls happens sequentially and now its working fine. Sorry for the wrong code and very thankful for your help indeed !

Replies are listed 'Best First'.
Re^5: File::Find Usage with 2 subroutines
by talexb (Canon) on Jun 17, 2013 at 19:10 UTC
      I found the issue, I showed wrong sequence of 'find' calls, actually the find was getting called recursively, and in that it retains the context of parent call probably.

    It's for this reason that we *strongly* encourage posters to show the simplest example that exhibits the bad behaviour. But I'm glad you got it all sorted. :)

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039315]
help
Chatterbox?
[Discipulus]: dear brother karl has "Furthermore I consider that Donald Trump must be impeached as soon as possible" in his sig
[erix]: ah, thanks Discipulus
[1nickt]: erix perhaps you could kindly point out your technique to roho and everyone will be happy.
[Discipulus]: but i'm also animalist, so i' hirted by 1nickt's sig: The way forward always starts with a mammal test... grin..
[erix]: I might if I did remember. It's probably somewhere in the site docs
[uhClem]: I don't favor that sort of thing around here but the place for our politics is wherever we live.
[uhClem]: And besides, the objection to it was off-topic.
[Discipulus]: 1nickt hide signature is a positive action; i think is not a solution here

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2017-06-22 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.