#!/usr/bin/perl
use strict;
use warnings;
require LWP::UserAgent;
use HTTP::Request;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
my $url = $ARGV[0];
my $file = $ARGV[1];
my $head = $ARGV[2];
my $text = do { local( @ARGV, $/ ) = $file or die $!; <> } ;
my $headers;
if ($head) {
$headers = HTTP::Headers->new(Accept=> $head);
}
my $req = HTTP::Request->new('POST', $url, $headers);
$req->content($text);
my $response = $ua->request($req);
print $response->content;
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.