#!/usr/bin/perl use strict; use warnings; use LWP::Simple::Post qw(post); #binary file open(FH, "binaryfile"); my $Data = do{local $/; }; close(FH); my $url = 'http://localhost:8080/cgi-bin/index.pl'; my $content = post($url, $Data); print $content; #### #!/usr/bin/perl use strict; use CGI; my $q = new CGI; print "\nMethod :", $ENV{REQUEST_METHOD}; print "\nContent_Length : ", $ENV{CONTENT_LENGTH}; #binary file open (FH, ">binaryoutput"); print FH $q->param() if ($q->param()); close(FH);