Re: Windows testing/debugging

[email protected] (Slaven Rezic)
Newsgroups perl.cpan.testers.discuss
Message-ID <[email protected]>
Serguei Trouchelle <[email protected]> writes:

> Probably somewhere in MSDN.

But the list form of system() can be fixed for Windows, see

    http://blogs.perl.org/users/graham_knop/2011/12/using-system-or-exec-safely-on-windows.html

>
> The problem is not in Perl, the problem is in Windows command line
> where single quote is not a quote, and double quote should be doubled
> (or escaped) to work as people from bash/sh world would expect.
>
> Examples:
>
> C:\>perl -M5.010 -we "say ""a"""
> a
>
> C:\>perl -M5.010 -we "say "a""
> Unquoted string "a" may clash with future reserved word at -e line 1.
> Name "main::a" used only once: possible typo at -e line 1.
> say() on unopened filehandle a at -e line 1.
>
> C:\>perl -M5.010 -we 'say "a"'
> Can't find string terminator "'" anywhere before EOF at -e line 1.
>
> C:\>perl -M5.010 -we "say \"a\""
> a
>
> On 2019-02-26 09:32, Karen Etheridge wrote:
>> Is there any documentation on that? `perldoc -f system` only describes
>> the different handling of "system LIST" vs "system PROGRAM LIST" on
>> windows, not any differences between different types of quote
>> characters.
>>
>> On Mon, Feb 25, 2019 at 11:28 PM Serguei Trouchelle <[email protected]> wrote:
>>> On 2019-02-25 05:11, David Cantrell wrote:
>>>
>>>> I don't need to use Andreas's analysis tool to figure out what the
>>>> common factor is in these test failures :-)
>>>>     http://cpantesters.org/distro/T/Test-Differences.html
>>>>
>>>> But I don't have access to any Windows machines, or any knowledge of how
>>>> to use any of the tools on that platform or how to install stuff. Does
>>>> anything exist now like the project a few years ago where Microsoft
>>>> donated some cloudy VMs for use by perl people that already had a
>>>> sensible toolchain and stuff installed?
>>>>
>>> I looked into the problem, the issue lies in calling system() with
>>> double quotes. Double quotes on Win32 behave different from Unix-like
>>> systems and should generally be avoided. This diff fixes the problem:
>>>
>>> 25,26c25,26
>>> <             [        "\\N{U+2603}", "\\N{U+1F4A9}"],
>>> <             [reverse "\\N{U+2603}", "\\N{U+1F4A9}"]
>>> ---
>>>   >             [        qq{\\N{U+2603}}, qq{\\N{U+1F4A9}}],
>>>   >             [reverse qq{\\N{U+2603}}, qq{\\N{U+1F4A9}}]
>>>
>>>
>>> --
>>> S.T.
>>

Regards,
    Slaven

-- 
Slaven Rezic - slaven <at> rezic <dot> de
  BBBike - route planner for cyclists in Berlin
  WWW version:                           http://www.bbbike.de
  Perl/Tk version for Unix and Windows:  http://bbbike.sourceforge.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.