Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^5: Local for lexicals

by JavaFan (Canon)
on Aug 11, 2009 at 10:06 UTC ( [id://787576]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Local for lexicals
in thread Local for lexicals

I know about *, although it doesn't seem to do much for lexicals, but what do you mean by pack-vars?
Well, of course * doesn't do anything for lexicals, as * is a typeglob. Lexicals don't live in typeglobs. A "pack-var" is just short for "package variable". You know that Perl has two kinds of variables, right? Lexical variables, and package variables (the latter is often confusingly called "global" variables, but that just shows ignorance. A lexical declared on an outer scope is "global" as well - "global" has to do with the broadness of the scope of the variable, not with its flavour).

I'm still not sure what exactly you want with your "lambda" variables. On the one hand, you seem to use them as named parameters, but that gives them a well defined scope - they are scoped to the subs, and just act as aliases for $_[0], $_[1], etc. OTOH, you seem to be want to set them from way out of their scope (your "localized lexicals" request). That has little to do with lambda functions I've encountered in functional languages (where there's no such thing as assignment or state change).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found