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

Re^5: Why callbacks?

by Fletch (Bishop)
on Mar 30, 2007 at 17:41 UTC ( [id://607546]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Why callbacks?
in thread Why callbacks?

Named subs all reside in the symbol table of the active package when they're declared (if the name is unqualified, that is; it's also possible to stick a sub into another package's namespace by fully qualifying the name: sub Other::Package::foo { ... }). It's also possible to get a sub which is only useable within a particular lexical scope by storing a coderef in a lexical scalar.

{ my $private_sub = sub { print "I'M IN UR SCOPE HIDIN UR LEXICALZ\n" } ## Can be called here $private_sub->( ); } ## Can't call it here

Log In?
Username:
Password:

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

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

    No recent polls found