Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Perl set -x emulation

by debiandude (Scribe)
on Aug 12, 2004 at 17:05 UTC ( [id://382378]=perlquestion: print w/replies, xml ) Need Help??

debiandude has asked for the wisdom of the Perl Monks concerning the following question:

Hey I was wondering if perl has a mode similiar to the shell scripts 'set -x' function. I would like to see how a program goes though things and see where it is spending most of its time. Thanks.

Replies are listed 'Best First'.
•Re: Perl set -x emulation
by merlyn (Sage) on Aug 12, 2004 at 17:25 UTC
    From perldoc perlrun:
    If you're just trying to get a print out of each line of Perl + code as it executes, the way that "sh -x" provides for shell scrip +ts, you can't use Perl's -D switch. Instead do this # If you have "env" utility env=PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS pr +ogram # Bourne shell syntax $ PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS prog +ram # csh syntax % (setenv PERLDB_OPTS "NonStop=1 AutoTrace=1 frame=2"; perl + -dS program) See perldebug for details and variations.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Re: Perl set -x emulation
by gaal (Parson) on Aug 12, 2004 at 17:12 UTC
      Awesome thanks!
Re: Perl set -x emulation
by gaal (Parson) on Aug 12, 2004 at 17:15 UTC
Re: Perl set -x emulation
by vegasjoe (Sexton) on Aug 12, 2004 at 23:49 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://382378]
Approved by kvale
Front-paged by ysth
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found