Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

betterworld's scratchpad

by betterworld (Curate)
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
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2023-12-06 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (31 votes). Check out past polls.

    Notices?