File Coverage

blib/lib/ShellQuote/Any/PERLANCAR.pm
Criterion Covered Total %
statement 8 8 100.0
branch 2 2 100.0
condition n/a
subroutine 2 2 100.0
pod 1 1 100.0
total 13 13 100.0


line stmt bran cond sub pod time code
1             package ShellQuote::Any::PERLANCAR;
2              
3             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4             our $DATE = '2020-03-10'; # DATE
5             our $DIST = 'ShellQuote-Any-PERLANCAR'; # DIST
6             our $VERSION = '0.003'; # VERSION
7              
8             # Be lean.
9             #use 5.010001;
10             #use strict 'subs', 'vars';
11             #use warnings;
12              
13             sub import {
14 1     1   8 my $caller = caller;
15              
16 1         2 *{"$caller\::shell_quote"} = \&shell_quote;
  1         1407  
17             }
18              
19             sub shell_quote {
20 2 100   2 1 963 if ($^O eq 'MSWin32') {
21 1         382 require Win32::ShellQuote;
22 1         1401 Win32::ShellQuote::quote_system_string(@_);
23             } else {
24 1         470 require String::ShellQuote;
25 1         896 String::ShellQuote::shell_quote(@_);
26             }
27             }
28              
29             1;
30             # ABSTRACT: Escape strings for the shell on Unix or MSWin32
31              
32             __END__