Padre isn't a webserver, and doesn't establish some internal server/browser relationship. If you run code in Padre, even if it's code that generates HTML, you're just going to see plain text output, marked up with HTML tags in this case. The same goes for running a CGI script from the command line.

Apache is a webserver. If properly configured, it can execute CGI scripts when a browser requests the correct URL. It then sends the raw output (much like what you see when you run a CGI script from the command line) to the client browser, and the browser, comprehending the HTML and CSS markup, renders it as a pretty web page.

The normal workflow for developing a CGI script would be to write some code, run it from the command line, possibly including the query string on the command line (CGI allows this), observing the output. And then once that's working, hit the correct URL (hopefully just internally reachable for now) with your local browser. Assuming Apache is configured to run the script, and assuming the script creates valid output for CGI, you'll see the webpage you want. This is an iterative process; back to the editor, on to the command line to preview, and then on to the browser to verify and see what needs tweaking.

A more advanced (and better) workflow would also have tests written that use a user agent to hit the web page and verify things are working right. With well written and well thought-out tests, the iterative process tends to go faster, and have fewer surprises.


Dave


In reply to Re: Output web page with Padre ... How ? by davido
in thread Output web page with Padre ... How ? by dofski

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.