WWW::Contact::Base - Base module for WWW::Contact::*
use WWW::Contact::MyMail; use Moose; extends 'WWW::Contact::Base'; sub get_contacts { my ($self, $email, $password) = @_; # reset $self->errstr(undef); my @contacts; my $ua = $self->ua; $self->debug("start get_contacts from MyMail"); # get contacts return wantarray ? @contacts : \@contacts; }
This module is mainly for you to write your own WWW::Contact::* (and used in my WWW::Contact::)
an instance of WWW::Mechanize
$self->ua->get('http://www.google.com');
If u want to use WWW::Mechanize::* instead of WWW::Mechanize, try
extends 'WWW::Contact::Base'; has '+ua_class' => ( default => 'WWW::Mechanize::GZip' );
turn on debug, default is off
$self->verbose(1); # turn on $self->verbose(0); # turn off
write debug info depends on $self->verbose
$self->debug("start get_contacts from MyMail");
Dumper(\$self->ua) to $file
$self->debug_to_file($file)
a wrapper of $self->ua->get, with $resp->is_success check
$self->get('http://www.google.com');
a wrapper of $self->ua->submit_form, with $resp->is_success check
$self->submit_form( form_number => 1, fields => { Email => $email, Passwd => $password, } );
WWW::Contact, WWW::Mechanize, Moose
Fayland Lam, <fayland at gmail.com>
<fayland at gmail.com>
Copyright 2008 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Contact, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Contact
CPAN shell
perl -MCPAN -e shell install WWW::Contact
For more information on module installation, please visit the detailed CPAN module installation guide.