Sure. You should take a look at the source of lwp-request,
an app that uses LWP::UserAgent to make requests. It does
exactly what you're looking for, so you could either use
it directly or incorporate its relevant bits into your
code.
Essentially, you just do:
# create a new LWP::UserAgent
my $ua = new LWP::UserAgent;
# create a new HTTP::Request, specifying
# the POST method
my $request = new HTTP::Request;
# read in the content from STDIN;
print "Enter in your content:\n";
my $content = join '', <STDIN>;
# attach the content to the request
# (change content-type to the appropriate type)
$request->header('Content-Type' => 'text/plain');
$request->header('Content-Length' => length $content);
$request->content($content);
# send request and get a response
my $response = $ua->request($request);
And that's that.