You're welcome to just use CGI (if your webserver supports it). It's deprecated because it's a poor foundation for a full application not because it's not useful and easy.

use strictures; use CGI ":standard"; use HTML::Entities; # Called https://mysite/cgi-bin/rpc.pl?args=to;the=call my $explicitly_scalar_param = param("args"); my $the = param("the"); print header(), start_html("Title..."), h1("header"), div("Do something safely with", encode_entities($explicitly_scalar_param), "and", encode_entities($the)), end_html; # Test on command line: ./rpc.pl 'args=to;the=call'

A *minimalist* modern take. If the thing is to grow, it should be in a framework like Mojolicious and friends. This uses PSGI via Plack::Request and the command line tool plackup. There are many deployment options for PSGI; from plackup through uWSGI.

use strictures; use Plack::Request; # Called https://mysite/not-the-cgi-bin/rpc.pl?args=to;the=call sub { my $req = Plack::Request->new(+shift); my $args = $req->parameters->{args}; my $the = $req->parameters->{the}; [ 200, [ "Content-Type" => "text/html" ], [ "HTML tags + output. You HTML encode ALL unknown data." ] ]; }; # Command line: plackup rpc.pl # HTTP::Server::PSGI: Accepting connections at http://0:5000/ # -> port 5000 on localhost ^^^

Update: the PSGI version would not go in the cgi-bin.


In reply to Re: Recommendation: CGI for a remote procedure call by Your Mother
in thread Recommendation: CGI for a remote procedure call by BernieC

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.