Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: while following perl hack book

by Util (Priest)
on Feb 05, 2008 at 02:45 UTC ( [id://666180]=note: print w/replies, xml ) Need Help??


in reply to Re^4: while following perl hack book
in thread while following perl hack book

  1. The hack author just omitted the parens. When find is predeclared (or imported in this case), these two lines are identical:
    find sub { ... }, $dir_name ; find( sub { ... }, $dir_name );
  2. I thought that as well, but when I tried to refactor to the more efficient form (passing all directories at once), I noticed that the code in the &wanted sub needs to know the "root" directory name: $file =~ s{^\Q$incl_dir/\E}{ };. Passing all the dirs at once removes the ability to see $incl_dir.

Replies are listed 'Best First'.
Re^6: while following perl hack book
by convenientstore (Pilgrim) on Feb 05, 2008 at 04:58 UTC
    thank you guys as always
    These closure, anonymous sub and callback are little bit over my head, so I must do more reading and coding on the subject
    I will comment more on this as I learn more

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found