Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Getting a code ref to main

by Courage (Parson)
on Nov 19, 2002 at 07:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://214047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found