Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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

Replies are listed 'Best First'.
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?
[Corion]: Lady_Aleena: :-D
[Lady_Aleena]: Corion, so do you think the gods would be open to taking over Cookies should I disappear for too long a time?
[Corion]: Lady_Aleena: Yes, I think so, but maybe someone else might also take care of the cookies ;)
[Lady_Aleena]: I'll put it out there.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-04-26 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.