line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::CLI::Interact::Role::FindMatch; |
2
|
|
|
|
|
|
|
{ $Net::CLI::Interact::Role::FindMatch::VERSION = '2.400000' } |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
652
|
use Moo::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# see if any regexp in the arrayref match the response |
7
|
|
|
|
|
|
|
sub find_match { |
8
|
0
|
|
|
0
|
0
|
|
my ($self, $text, $matches) = @_; |
9
|
0
|
0
|
|
|
|
|
$matches = ((ref $matches eq ref qr//) ? [$matches] : $matches); |
10
|
|
|
|
|
|
|
return undef unless |
11
|
0
|
0
|
|
|
|
|
(scalar grep {ref $_ eq ref qr//} @$matches) == scalar @$matches; |
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
470
|
use List::Util 'first'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
172
|
|
14
|
0
|
|
|
0
|
|
|
return first { $text =~ $_ } @$matches; |
|
0
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |