next up previous contents
Next: Online Documentation Up: Command Line Flags Previous: -e: Execute script from   Contents

-d: Use the perl debugger

Among the many remarkable features of the perl interpreter, not the least of them is the full-featured source level debugger. You can learn about the debugger through the perldebug manual page.

One very useful trick is to make a perl ``shell'', by invoking the perl debugger with the trivial program consisting of just zero:

     perl -de 0
You'll see some useful information about the debugger, and will finally be greeted with a prompt like this:
     main::(-e:1):   0   
     DB<1>
At that point, any perl statements you type will immediately be executed. This can be especially useful for exploring how perl works when it's not clear from a written explanation.



Phil Spector 2002-10-18