| 1 | package PERLANCAR::ShellQuote::Any; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | our $DATE = '2016-09-27'; # DATE | |||||||||
| 4 | 2 | our $VERSION = '0.002'; # VERSION | |||||||||
| 5 | |||||||||||
| 6 | # Be lean. | ||||||||||
| 7 | #use 5.010001; | ||||||||||
| 8 | #use strict 'subs', 'vars'; | ||||||||||
| 9 | #use warnings; | ||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | my $caller = caller; | |||||||||
| 13 | |||||||||||
| 14 | 1 | *{"$caller\::shell_quote"} = \&shell_quote; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 2 | ▶ | sub shell_quote { | ||||||||
|
Subroutine
shell_quote: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 2 | ▶ | if ($^O eq 'MSWin32') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 1 | require Win32::ShellQuote; | |||||||||
| 20 | 1 | Win32::ShellQuote::quote_system_string(@_); | |||||||||
| 21 | } else { | ||||||||||
| 22 | 1 | require String::ShellQuote; | |||||||||
| 23 | 1 | String::ShellQuote::shell_quote(@_); | |||||||||
| 24 | } | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 2 | 1; | |||||||||
| 28 | # ABSTRACT: Escape strings for the shell on Unix or MSWin32 | ||||||||||
| 29 | |||||||||||
| 30 | __END__ | ||||||||||