POST to URL from Perl Script

By: Emiley J Viewed: 153195 times    

This sample code in perl shows how to connect and POST data to any URL from a perl script.
#--------- 
use LWP::UserAgent; 
my $ua = new LWP::UserAgent;

my $response 
= $ua->post('https://www.samples.com/submit.cgi', 
{ param1 => 'value1', 
param2 => 'value2', 
});

my $content = $response->content; 
#---------

Most Viewed Articles (in Perl )

Latest Articles (in Perl)

Comment on this tutorial