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

Re: Getting a code ref to main

by Courage (Parson)
on Nov 19, 2002 at 07:37 UTC ( #214047=note: print w/ replies, xml ) Need Help??


in reply to Getting a code ref to main

main_cv just returns Perl internal variable PL_main_cv which in turn serves special purposes.

As I see a situation, it is a very special *CV value that can not be deparsed (like can not be deparsed, say, sort internal function), and there should be special effort be made to make main_cv deparse-able, which, in turn, seems do-able to me, but not implemented nowadays.

Best wishes,
Courage, the Cowardly Dog


Comment on Re: Getting a code ref to main
Select or Download Code
Re^2: Getting a code ref to main
by diotalevi (Canon) on Nov 19, 2002 at 13:16 UTC

    Well... ok. So then if main_cv isn't good enough is there a way to get a proper code reference to the main() subroutine or whatever the heck it's called?

    __SIG__ use B; printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2014-07-23 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (147 votes), past polls