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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://214047]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-02-18 05:19 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (250 votes). Check out past polls.