sub upload { my( $data)= @_; my $ua = LWP::UserAgent->new; my $req= POST $SCRIPT_URL, Content_Type => 'form-data', Content => [ status => 'ok', uploaded_file => [ undef, # content provided below $basename, Content_Type => 'text/html', Content => $data ], ], ; # this might be wrong, the real code uses a callback to output the results # as they come back from $SCRIPT my $result= $ua->request($req)->content; }