Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Probably you are out of luck because few shared environments are going to let you run your own webserver or let you use any new ports which is necessary since 80 is taken. That said, this will work if your user account has permission. Plack is required for this solution. I rewrote your CGI with CGI.pm. It's more reliable and once you're used to it, much easier to read.

NetWallah's advice is also good, just plack is easier. See also HTTP::Server::Simple::CGI.

Your, sorta, CGI

#!/usr/bin/env perl # File called pm-1217158.cgi use strict; use warnings; use CGI ":standard"; # Import common functions. print header(), start_html("Hello, Nurse!"), h1("OHAI!"), end_html();

Run a micro server

cow@moo[323]~>plackup -L Shotgun -MPlack::App::WrapCGI \ -e 'Plack::App::WrapCGI->new( script => q{pm-1217158.cgi} )' HTTP::Server::PSGI: Accepting connections at http://0:5000/

Then, if you were allowed to start it, you can visit your webhost at port 5000 to see your CGI. Just substitute the "0" in the URL above with the domain or IP.


In reply to Re: PERL-CGI on shared unix server by Your Mother
in thread PERL-CGI on shared unix server by rahu_6697

Title:
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found