http://qs321.pair.com?node_id=1230723


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 (Cardinal) 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 (Patriarch) 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.