Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by dpuu (Chaplain)
on Nov 19, 2008 at 23:24 UTC ( #724759=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 ?

Thanks for the reply. Unfortunately, that doesn't seem applicable to the problem I was trying to solve (which I guess I didn't state in my original post): the ultimate goal was for a script to detect that it was being run under -d:NYTProf, and to add that option (and other similar things) to various child perl-scripts that it runs.

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


Comment on Re^2: Finding what args were passed to the perl interpretter ?
Download Code
Re^3: Finding what args were passed to the perl interpretter ?
by JavaFan (Canon) on Nov 20, 2008 at 00:26 UTC
    I don't think there's a general way to get the arguments to perl from with Perl. However, an XS routine may be able to access argv and argc (although I've no idea whether perl itself leaves them as is).

    As for your specific request, detecting -d:NYTProf, it may be done. One of the effects of -d:foo is that it loads Devel::foo, and calls Devel::foo -> import. You may want to try to mask Devel::NYTProf::import.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-12-26 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls