line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Mechanize::FormFiller::Value::Random; |
2
|
5
|
|
|
4
|
|
1761
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
779
|
|
3
|
4
|
|
|
4
|
|
25
|
use base 'WWW::Mechanize::FormFiller::Value'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1486
|
|
4
|
4
|
|
|
4
|
|
4563
|
use Data::Random qw(rand_enum); |
|
4
|
|
|
|
|
13025
|
|
|
4
|
|
|
|
|
304
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
28
|
use vars qw( $VERSION ); |
|
5
|
|
|
|
|
26605
|
|
|
4
|
|
|
|
|
650
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.11'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
7
|
|
|
7
|
1
|
106
|
my ($class,$name,@values) = @_; |
11
|
8
|
|
|
|
|
95
|
my $self = $class->SUPER::new($name); |
12
|
8
|
|
|
|
|
69
|
$self->{values} = [ @values ]; |
13
|
|
|
|
|
|
|
|
14
|
8
|
|
|
|
|
44
|
$self; |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub value { |
18
|
6
|
|
|
5
|
1
|
13
|
my ($self,$input) = @_; |
19
|
6
|
|
|
|
|
91
|
my @values; |
20
|
5
|
50
|
|
|
|
23
|
@values = @{$self->{values}} |
|
5
|
|
|
|
|
20701
|
|
21
|
|
|
|
|
|
|
if ($self->{values}); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Pick a choice among the allowed values for this input |
24
|
|
|
|
|
|
|
# unless we got some prespecified values |
25
|
5
|
50
|
|
|
|
21
|
@values = $input->possible_values unless scalar @values; |
26
|
5
|
|
|
|
|
728
|
rand_enum( set => \@values, size => 1 ); |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |