Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: XML::Twig newbie question

by Anonymous Monk
on Sep 18, 2012 at 07:31 UTC ( #994219=note: print w/ replies, xml ) Need Help??


in reply to Re^2: XML::Twig newbie question
in thread XML::Twig newbie question

Another way would be to make the subroutine curried (that is expecting to get the parameters separately, not all at once):

Sure, you could write your closure that way ( the schönfinkeling way), but it gains you nothing in this example, it just takes a little more memory


Comment on Re^3: XML::Twig newbie question
Re^4: XML::Twig newbie question
by Jenda (Abbot) on Sep 18, 2012 at 10:57 UTC

    Depends on the complexity of the subroutine. Maybe you do not want to include all that code in the middle of the loop. I would not sweat over the tiny difference in memory footprint or the cost of two additional subroutine calls. Use whatever makes the code easier to maintain.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2014-09-19 12:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (137 votes), past polls