Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Using the Perl Debugger (-d)

by nferraz (Monk)
on Jan 26, 2007 at 17:12 UTC ( [id://596759]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using the Perl Debugger (-d)
in thread Using the Perl Debugger (-d)

I love Smart::Comments! Basically, it requires you to write debug comments like this:

sub foo { ### entering foo my $x = shift; ### x: $x return $x + 1; } ### starting... my $y = foo(42); ### y: $y ### finish exit;

As you can see, they're just simple comments, until you use Smart::Comments, when they'll magically print the following output to STDERR:

### starting... ### entering foo ### x: 42 ### y: 43 ### finish

The best part is that, when you disable Smart::Comments, they will sit quietly there -- just like comments they are -- documenting your code, but not being executed.

Simple, useful... smart!!! :)

Replies are listed 'Best First'.
Re^4: Using the Perl Debugger (-d)
by djp (Hermit) on Jan 29, 2007 at 02:54 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-06-19 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.