27 Sep 2016 04:34:42 UTC
- Distribution: Win32-ShellQuote
- Module version: 0.003001
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (6434 / 0 / 0)
- KwaliteeBus factor: 1
- 84.33% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity24 month
- Download (15.35KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- COPYRIGHT AND LICENSE
Win32::ShellQuote - Quote argument lists for Win32
use Win32::ShellQuote qw(:all); system quote_system('program.exe', '--switch', 'argument with spaces or other special characters');
Quotes argument lists to be used in Win32 in several different situations.
Windows passes its arguments as a single string instead of an array as other platforms do. In almost all cases, the standard Win32 CommandLineToArgvW function is used to parse this string. cmd.exe has different rules for handling quoting, so extra work has to be done if it is involved. It isn't possible to consistantly create a single string that will be handled the same by cmd.exe and the stardard parsing rules.
Perl will try to detect if you need the shell by detecting shell metacharacters. The routine that checks that uses different quoting rules from both cmd.exe and the native Win32 parsing. Extra work must therefore be done to protect against this autodetection.
Quotes as a string to pass directly to a program using native methods like Win32::Spawn(). This is the safest option to use if possible.
Quotes as a string to be run through cmd.exe, such as in a batch file.
Like "quote_system_list", but returns a single string. Some argument lists cannot be properly quoted using this function.
Quotes as a single string that will always be run with cmd.exe.
Quotes a single parameter in native form.
Escapes a string to be passed untouched by cmd.exe.
Newlines (\n or \r) and null (\0) can't be properly quoted when running through cmd.exe.
This module re-implements some under-specified part of the perl internals to accurately perform its work.
haarg - Graham Knop (cpan:HAARG) <email@example.com>
Mithaldu - Christian Walde (cpan:MITHALDU) <firstname.lastname@example.org>
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Win32::ShellQuote, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Win32::ShellQuote
For more information on module installation, please visit the detailed CPAN module installation guide.