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

Re^3: Can I from within a module access variables from the calling program?

by tobyink (Abbot)
on Oct 25, 2012 at 13:29 UTC ( #1000866=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Can I from within a module access variables from the calling program?
in thread Can I from within a module access variables from the calling program?

The only 5.10-specific feature I used was say which is a new (well... five years old) keyword which works like print but automatically appends a new line.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re^3: Can I from within a module access variables from the calling program?
Select or Download Code
Re^4: Can I from within a module access variables from the calling program?
by HJO (Acolyte) on Oct 25, 2012 at 13:33 UTC

    Oh indeed that's quite usefull. Thanks I think i'll be able to adapt this

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-12-19 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (74 votes), past polls