Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

betterworld's scratchpad

by betterworld (Curate)
on Feb 19, 2005 at 16:46 UTC ( [id://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 learning in the Monastery: (5)
As of 2024-03-29 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found