#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->agent("AgentName/post0.1" . $ua->agent);

#create a request
my $req = new HTTP::Request POST => $ARGV[0] . $ARGV[1];
my $file;

open (FILEHANDLE, '<' . $ARGV[1]) or die "File did not open \n";
while(<FILEHANDLE>) {
	$file .= $_;
}

$req->content($file);

#Pass request to the user agent and get a response back
my $res = $ua->request($req);

#Check the outcome of the response
if ($res->is_success) {
	print $res->content;
} else {
	print "Bad luck this time\n";
}
