{ package MyMech; use vars qw(@ISA); @ISA = qw(WWW::Mechanize); sub new { my $self = WWW::Mechanize::new(@_); $self->agent("www-mechanize/$WWW::Mechanize::VERSION"); $self; } # this routine gets called when your browser # would otherwise be asked to provide a # username and password sub get_basic_credentials { my ($self, $realm, $uri) = @_; print( STDERR " - providing auth to realm \"$realm\"\n" ); return( $username, $password ); } }