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; } #### sub exe_script { my( $data)= @_; my $req= POST $SCRIPT, Content_Type => 'form-data', Content => [ status => 'ok', uploaded_file => [ undef, # content provided below 'whatever', Content_Type => 'text/html', Content => $data, ], ], ; open( my $script, "| $SCRIPT") or exit_status( Error => "cannot call script: $!"); my $user= remote_user(); $ENV{REMOTE_USER}= $user; my $content= $req->content; print {$script} $content; exit; }