Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Scalar Value Not Available To Subroutine

by tobyink (Canon)
on Dec 20, 2012 at 17:13 UTC ( [id://1009762]=note: print w/replies, xml ) Need Help??


in reply to Scalar Value Not Available To Subroutine

It seems that $uid should be visible and defined in the sub. The lexical scope of the $uid variable ought to cover the sub, and the dynamic scope of the loop should cover the calls to the sub. Odd; I can't say I exactly understand what's happening here.

Works if you do our $uid though.

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

Log In?
Username:
Password:

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

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

    No recent polls found