Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Okay, let me put my name on the following suggestions, and try my best to make them positive ones:

Yes, there are debuggers for Plack, as for every other type of [Perl ...] application, but I have generally found them to be of limited usefulness.   In fact, I rarely use debuggers at all.   Plack (PSGI) applications are actually much easier to debug in general, e.g. compared to mod_perl, because you can cleanly separate them from the environment in which they are normally run, and instead run them in a functionally-equivalent environment that is much easier to debug.

In the case of Plack, that would start with the plackup command, but also with quite a number of prove-compatible testing frameworks.   A compatible HTTP server runs right at your own command-line, or within the test framework.   Or, a tester simply sends a request-object to your script and evaluates the response-object that it returns.   Unlike mod_perl, PSGI applications are not embedded into their environment, but are simply call-and-response remote procedure call (RPC) handlers who run a certain number of requests until they commit hara-kiri and are promptly reborn.

Not to get into any hint of mod_perl bashing, I have re-engineered several “embedded apps” to instead use the PSGI technique (and not just in the Perl language), and each time found that debugging became very simple and that some fairly intractable bugs were found almost immediately after the conversion.

For most debugging purposes, I simply do a lot of print STDERR calls, which show-up right at my terminal window while running plackup on the command line.   I then accompany that with some very-conventional (prove ...) test suites to thoroughly exercise the code in order to flush out the more subtle problems.

In reply to Re: How to use Plack InteractiveDebugger by sundialsvc4
in thread How to use Plack InteractiveDebugger by jjmoka

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2023-12-09 22:08 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (38 votes). Check out past polls.