in reply to WebMail authentication
Personally, I'd use WWW::Mechanize to handle this all automatically.
Quick plan:
#!/usr/bin/perl -w use strict; use WWW::Mechanize; my $target_url = "https://webmail.com/the/page/I/want"; my $user = "myusername"; my $pass = "<=6chars"; my $ua = WWW::Mechanize->new(); my $resp = $ua->get( $target_url ); #Dear student, check here that resp is valid... #check if page looks like the login page, by looking for a field named + "login" if ( $ua->form_name("login") ) { $ua->field( "username", $user ); #look for a field named "username" $ua->field( "password", $pass ); #look for a field named "password" $ua->submit(); #submit the form } #$ua should now have the comment you were hoping for.
|
|---|