Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Finding what args were passed to the perl interpretter ?

by dpuu (Chaplain)
on Nov 20, 2008 at 00:19 UTC ( #724765=note: print w/replies, xml ) Need Help??


in reply to Re: Finding what args were passed to the perl interpretter ?
in thread Finding what args were passed to the perl interpretter ?

How would a perl script attach an strace to itself in such a way that it can see its own invocation? If I simply do system "strace -p $$" then it's too late (the execve occurred in the past!)
--Dave
Opinions my own; statements of fact may be in error.

Replies are listed 'Best First'.
Re^3: Finding what args were passed to the perl interpretter ?
by almut (Canon) on Nov 20, 2008 at 00:28 UTC

    Well, the idea would be to attach strace to whatever is calling perl... Why would you want to do it from within the script itself?

      See my previous post: I was wanting the script to figure out if it was invoked using "-d:NYTProf". I like JavaFan's approach of checking if Devel::NYTProf->can("import") -- though obviously that's not ideal.

      I was sort of hoping to answer the more general problem: some form of auto-populated $PERL5OPTS that I can use in much the same way as ${MAKE} in recursive makefiles. But the specific answer is good for now

      --Dave
      Opinions my own; statements of fact may be in error.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2016-12-06 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.