line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Mechanize::FormFiller::Value::Random; |
2
|
5
|
|
|
4
|
|
1716
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
107
|
|
3
|
4
|
|
|
4
|
|
18
|
use base 'WWW::Mechanize::FormFiller::Value'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
933
|
|
4
|
4
|
|
|
4
|
|
1729
|
use Data::Random qw(rand_enum); |
|
4
|
|
|
|
|
49940
|
|
|
4
|
|
|
|
|
228
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
24
|
use vars qw( $VERSION ); |
|
5
|
|
|
|
|
23089
|
|
|
4
|
|
|
|
|
525
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.13'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
7
|
|
|
7
|
1
|
174
|
my ($class,$name,@values) = @_; |
11
|
8
|
|
|
|
|
40
|
my $self = $class->SUPER::new($name); |
12
|
8
|
|
|
|
|
57
|
$self->{values} = [ @values ]; |
13
|
|
|
|
|
|
|
|
14
|
8
|
|
|
|
|
35
|
$self; |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub value { |
18
|
6
|
|
|
5
|
1
|
15
|
my ($self,$input) = @_; |
19
|
6
|
|
|
|
|
76
|
my @values; |
20
|
5
|
|
|
|
|
15789
|
@values = @{$self->{values}} |
21
|
5
|
50
|
|
|
|
27
|
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
|
|
|
|
16
|
@values = $input->possible_values unless scalar @values; |
26
|
5
|
|
|
|
|
438
|
rand_enum( set => \@values, size => 1 ); |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |