Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Real life uses for closures.

by ikegami (Pope)
on Feb 14, 2013 at 08:09 UTC ( #1018698=note: print w/replies, xml ) Need Help??


in reply to Real life uses for closures.

Technically, f is a closure which captures $constant:
package Module; my $constant = 'foo'; sub f { ... $constant ... } 1;

Given your mention of state, this is probably not quite what you had in mind when you mentioned "simple C-style 'static' storage".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018698]
help
Chatterbox?
[Discipulus]: gee! how much rumor for a post with no content!
[Discipulus]: an almshouse more than a monastery ;=)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-11-23 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (337 votes). Check out past polls.

    Notices?