It should be clear why you can't replicate the CGI behavior from the command-line; the normal way of getting to form B is to submit an HTML form to a webserver, but there's no webserving and no submitting going on from the command line. One way of getting to form B is to give the script input that looks like it came from form A, and this is possible because CGI.pm can process arguments from the command line.

./myscript.pl foo=bar baz=bletch
will act just like
http://www.foo.com/cgi-bin/myscript.pl?foo=bar&baz=bletch

So you might look into that (I think you can even save a CGI object to a file, which would replicate the form variables; you could then read in those variables on the command line with ./myscript.pl < savefile. I'll admit to not knowing *much* about that, though.

As an aside: you don't *need* the debugger to track down the errors. Just sprinkle some print statements into your CGI routines to help you track the changes to the variables over time, that will help you localize the errors.

HTH

Philosophy can be made out of anything. Or less -- Jerry A. Fodor


In reply to Re: Using Perl's Debugger on by arturo
in thread Using Perl's Debugger on by nysus

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.