Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Output web page with Padre ... How ?

by davido (Archbishop)
on Apr 20, 2014 at 16:16 UTC ( #1082951=note: print w/replies, xml ) Need Help??

in reply to Output web page with Padre ... How ?

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.


  • Comment on Re: Output web page with Padre ... How ?

Replies are listed 'Best First'.
Re^2: Output web page with Padre ... How ?
by dofski (Initiate) on Apr 21, 2014 at 20:53 UTC

    Thank-you for clarification and advice. I now understand the significance of Padre not being a web server. I am now doing I think what you say. I use Padre to check the code initially. Then I run the .pl program from the browser. </pl>

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082951]
usemodperl gained... A NEW CAR! Thank you vroom :-)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-06-21 01:40 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.