| 1 |
package WWW::Mechanize::FormFiller::Value; |
| 2 |
|
| 3 |
use vars qw( $VERSION @ISA ); |
| 4 |
$VERSION = '0.13'; |
| 5 |
@ISA = (); |
| 6 |
|
| 7 |
sub new { |
| 8 |
my ($class,$name) = @_; |
| 9 |
my $self = { |
| 10 |
name => $name, |
| 11 |
}; |
| 12 |
|
| 13 |
bless $self,$class; |
| 14 |
|
| 15 |
$self; |
| 16 |
}; |
| 17 |
|
| 18 |
# You're supposed to override this |
| 19 |
sub value { undef }; |
| 20 |
|
| 21 |
# You can't set the name, but retrieve it |
| 22 |
sub name { my $result = $_[0]->{name}; $_[0]->{name} = $_[1] if scalar @_ == 2; $result }; |
| 23 |
|
| 24 |
1; |
| 25 |
__END__ |
| 26 |
|
| 27 |
=head1 NAME |
| 28 |
|
| 29 |
WWW::Mechanize::FormFiller::Value - Base class for HTML form values |
| 30 |
|
| 31 |
=head1 SYNOPSIS |
| 32 |
|
| 33 |
=begin example |
| 34 |
|
| 35 |
# This class is not used directly |
| 36 |
|
| 37 |
=end example |
| 38 |
|
| 39 |
=head1 DESCRIPTION |
| 40 |
|
| 41 |
This class is the base class for different values - it defines the |
| 42 |
interface implemented by the subclasses. |
| 43 |
|
| 44 |
=over 4 |
| 45 |
|
| 46 |
=item new NAME |
| 47 |
|
| 48 |
Creates a new value which will correspond to the HTML field C<NAME>. |
| 49 |
|
| 50 |
=item name [NEWNAME] |
| 51 |
|
| 52 |
Gets and sets the name of the HTML field this value corresponds to. |
| 53 |
|
| 54 |
=item value FIELD |
| 55 |
|
| 56 |
Returns the value to put into the HTML field. |
| 57 |
|
| 58 |
=back |
| 59 |
|
| 60 |
=head2 EXPORT |
| 61 |
|
| 62 |
None by default. |
| 63 |
|
| 64 |
=head2 COPYRIGHT AND LICENSE |
| 65 |
|
| 66 |
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
| 67 |
|
| 68 |
Copyright (C) 2002,2003 Max Maischein |
| 69 |
|
| 70 |
=head1 AUTHOR |
| 71 |
|
| 72 |
Max Maischein, E<lt>[email protected]<gt> |
| 73 |
|
| 74 |
Please contact me if you find bugs or otherwise improve the module. More tests are also very welcome ! |
| 75 |
|
| 76 |
=head1 SEE ALSO |
| 77 |
|
| 78 |
L<WWW::Mechanize>,L<WWW::Mechanize::Shell>,L<WWW::Mechanize::FormFiller>,L<WWW::Mechanize::FormFiller::Value::Fixed>, |
| 79 |
L<WWW::Mechanize::FormFiller::Value::Default>,L<WWW::Mechanize::FormFiller::Value::Random>,L<WWW::Mechanize::FormFiller::Value::Interactive> |