Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: accessing stashes

by NetWallah (Canon)
on Mar 01, 2019 at 17:28 UTC ( #1230723=note: print w/replies, xml ) Need Help??

in reply to accessing stashes

>perl -E " sub testing{234}; ref($main::{$_}) eq qq|CODE| and say q +q|-->\$main::$_ is a Code ref| for sort keys %main::" -->$main::testing is a Code ref

                As a computer, I find your faith in technology amusing.

Replies are listed 'Best First'.
Re^2: accessing stashes
by choroba (Archbishop) on Mar 01, 2019 at 17:42 UTC
    It works for me in blead, but doesn't output anything in 5.18.2. Also, it doesn't seem to work for other packages than main.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^2: accessing stashes
by ikegami (Pope) on Mar 01, 2019 at 19:57 UTC

    It also doesn't work if there's a scalar/array/hash/... with the same name as the sub.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2021-03-03 18:14 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (86 votes). Check out past polls.