Perl - Using HTTP::Lite
I recently had to use the HTTP::Lite perl module and thought I would share an example of how to use it. HTTP::Lite was is available on www.cpan.org; its very lightweight and has no dependancies other than Socket & Fcntl which included with almost all Perl implementations by default. Based on the examples by the HTTP::Lite author Roy Hooper rhooper@thetoybox.org [perl] #!perl use HTTP::Lite; # # Get and print out the headers and body of the Google homepage # $http = new HTTP::Lite; $req = $http->request("http://www.google.co.uk/") or die "Unable to get document: $!"; # Print the reconstructed status line print $http->protocol() . " " . $req . " " . $http->status_message() . ""; # Get the Headers & Body @headers = $http->headers_array(); $body = $http->body(); # Display each Header foreach $header (@headers) { print $header . "\n"; } print "\n\n"; # Display the Body print $body . "\n"; # # Execute a Google Search using the POST method # $http = new HTTP::Lite; # Post variables %vars = ( "hl" => "en", "q" => "cpan", "btnG" => "Search", "meta" => "" ); $http->prepare_post(%vars); $req = $http->request("http://www.google.co.uk/search") or die "Unable to get document: $!"; # Print the reconstructed status line print $http->protocol() . " " . $req . " " . $http->status_message() . ""; # Get the Headers & Body @headers = $http->headers_array(); $body = $http->body(); # Display each Header foreach $header (@headers) { print $header . "\n"; } print "\n\n"; # Display the Body print $body . "\n"; [/perl] Google doesnt support queries by POST methods anymore, so the response to the second request here will be a "501 Not Implemented".
The Cutler.sg Newsletter
Weekly notes on AI, engineering leadership, and building in Singapore. No fluff.
Two Papers That Puncture the Hype
One paper shows frontier models degrade as context grows — even on trivial tasks. The other shows reasoning models hit a wall and think less as problems get harder. Read carefully, both point at the same engineering response.
The 30 Principles for Agentic Engineering — Part 5: Calibration and Reality
Principles 26–30. The calibration layer that catches what the rest of the framework would miss: a PR-noise budget, independent verification, model-swap regression discipline, the 15-tool-call rule, and protecting junior development.
The 30 Principles for Agentic Engineering — Part 3: The Harness
Principles 15–20. The harness configuration that keeps the kernel and lifecycle cheap: CLAUDE.md under 200 lines, hooks for real incidents, skills that auto-invoke, subagent isolation, pinning, and Stage 5 distribution.