Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: REST API Server in Perl

by philipbailey (Curate)
on Feb 16, 2022 at 11:42 UTC ( [id://11141421]=note: print w/replies, xml ) Need Help??

in reply to REST API Server in Perl

Personally I would prefer to use one of the standard Perl web frameworks (Dancer, Mojolicious or Catalyst). Dancer is the most minimal, but all 3 have a fair number of dependencies. Your requirements may be simple now, but these things have a way of growing, and you may then find that your lightweight choice will suffer growing pains.

One low-level option, if you really insist on it, is HTTP::Daemon. That's a subclass of IO::Socket::IP, which means you can play with sockets directly if you choose to. If you don't want to use the module directly, its source code might give you some inspiration.

Replies are listed 'Best First'.
Re^2: REST API Server in Perl
by hippo (Bishop) on Aug 28, 2023 at 21:32 UTC

      Yes, Mojolicious is very self-contained and doesn't have non-core dependencies outside its own ecosystem. However, my recollection is that at least at one point, doing a cpanm Mojolicious or equivalent, actually fetched and installed a list of dozens of dependencies (within that ecosystem, but nonetheless dependencies).

      Having said that, I tried this today with Perl 5.38.0 and Mojolicious 9.33, which are current as I write this, and everything was installed in one go. So either they changed something about their packaging, or my recollection is defective. It's certainly still true that Mojolicious consists of dozens of modules.

        > fetched and installed a list of dozens of dependencies

        Maybe you were on a RedHat with not all core modules installed?

        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        The framework is split up into modules, which isn't any different from Dancer or Catalyst in this regard.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141421]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-05-29 05:05 GMT
Find Nodes?
    Voting Booth?

    No recent polls found