Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Real life uses for closures.

by ikegami (Patriarch)
on Feb 14, 2013 at 08:09 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1018698]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-23 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found