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":



  • 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.