my $postjson = ''; ## a big input normally my $response= open(PIPIE,'|curl -d @- destination') or die "smth"; print PIPIE $postjson; close PIPIE;