Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

betterworld's scratchpad

by betterworld (Deacon)
on Feb 19, 2005 at 16:46 UTC ( #432752=scratchpad: print w/ replies, xml ) Need Help??

use strict; use warnings; use B; package Foo; sub thing {} my $ref1 = \&package1::sub1; my $ref2 = \&thing; package Bar; for ($ref1, $ref2) { print B::svref_2object($_)->STASH->NAME, "\n"; print B::svref_2object($_)->GV->STASH->NAME, "\n"; } # Output: # main # package1 # Foo # Foo

Apparently $cv->STASH->NAME is always "main" if the reference was constructed via an absolute name (like $ref1 was).

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-12-29 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (185 votes), past polls