File Coverage

blib/lib/PERLANCAR/ShellQuote/Any.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 PERLANCAR::ShellQuote::Any;
2              
3             our $DATE = '2016-09-27'; # DATE
4             our $VERSION = '0.002'; # VERSION
5              
6             # Be lean.
7             #use 5.010001;
8             #use strict 'subs', 'vars';
9             #use warnings;
10              
11             sub import {
12 1     1   6 my $caller = caller;
13              
14 1         2 *{"$caller\::shell_quote"} = \&shell_quote;
  1         1046  
15             }
16              
17             sub shell_quote {
18 2 100   2 1 418 if ($^O eq 'MSWin32') {
19 1         427 require Win32::ShellQuote;
20 1         975 Win32::ShellQuote::quote_system_string(@_);
21             } else {
22 1         385 require String::ShellQuote;
23 1         576 String::ShellQuote::shell_quote(@_);
24             }
25             }
26              
27             1;
28             # ABSTRACT: Escape strings for the shell on Unix or MSWin32
29              
30             __END__