| 1 | package Net::ADB::Util; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use v5.16; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use Exporter 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | our $VERSION = '0.01'; | |||||||||
| 12 | |||||||||||
| 13 | 2 | our @EXPORT_OK = qw(wantlist croak_unknown_params shell_quote); | |||||||||
| 14 | 2 | our @CARP_NOT = qw(Net::ADB Net::ADB::Device); | |||||||||
| 15 | |||||||||||
| 16 | # Must be called as the expression of a "return": the caller's context is | ||||||||||
| 17 | # passed through (return wantlist(\@list), not my $x = wantlist(...)) | ||||||||||
| 18 | 1 | ▶ | sub wantlist { wantarray ? @{$_[0]} : $_[0] } | ||||||||
|
Subroutine
wantlist: called CC=2 SCAR=7.2
Pod
documented
Branch: 1 branch
| |||||||||||
| 19 | |||||||||||
| 20 | 2 | ▶ | sub croak_unknown_params { | ||||||||
|
Subroutine
croak_unknown_params: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||
| 21 | 2 | my $params = shift; | |||||||||
| 22 | 0 | ▶ | Carp::croak('Unknown parameters: ' . join ', ', sort keys %{$params}) if %{$params}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 2 | return; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | sub shell_quote { | ||||||||
|
Subroutine
shell_quote: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 27 | 0 | my $string = shift; | |||||||||
| 28 | 0 | $string =~ s/'/'\\''/g; | |||||||||
| 29 | 0 | return "'$string'"; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 2 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||