Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Closures clarification

by moritz (Cardinal)
on Dec 04, 2007 at 12:46 UTC ( #654766=note: print w/replies, xml ) Need Help??


in reply to Closures clarification

First of all a closure is a subroutine, and your second example doesn't include one.

Secondly in a closure you have access to a variable in an outer scope, which is "enclosed" in the sub (hence the name), in your first example $total_size.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2021-03-02 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (32 votes). Check out past polls.

    Notices?