DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Perl - Send Form POST

  • submit to reddit
        // Manda le informazioni per il login ad un determinato sito

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

my $user = "user";
my $pass = "pass";

my $browser = LWP::UserAgent->new();

my $responde = HTTP::Request->new(POST => "");
$responde->content("user=" . $user . "&pass=" . $pass);



Snippets Manager replied on Wed, 2008/07/30 - 3:40pm

all form fields' names and values should be passed through urlencode()