Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: spaces in shell commands ( Win32::ShellQuote )

by Anonymous Monk
on Sep 18, 2014 at 07:49 UTC ( [id://1101006]=note: print w/replies, xml ) Need Help??


in reply to Load XML issues

The issue is that load_xml in this type of situation does not like that there is a space in the directory path ("My Folder").

:) Nope, load_xml doesn't care, open on the other hand might if the shell cares ... learn to work your shell :) Win32::ShellQuote

  • Comment on Re: spaces in shell commands ( Win32::ShellQuote )

Replies are listed 'Best First'.
Re^2: spaces in shell commands ( Win32::ShellQuote )
by salva (Canon) on Sep 18, 2014 at 08:02 UTC
    I was going to say that you can avoid the shell enterely passing the command and arguments to open separately:
    open my $H, '-|', $mkvext, 'chapters', $item;
    Then, I remembered that on Windows, at the OS level, a command is not invoked as a list of program+arguments but as a single line so, I don't now what would happen.

    Does the execv emulation used by perl internally take care of quoting the arguments properly?

      salva, unfortunately you are right. This is what will happen:
      List form of pipe open not implemented at -e line 1.

      L*
      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      Does the execv emulation used by perl internally take care of quoting the arguments properly?

      As far as I can tell Perl doesn't emulate execv and execvp on Windows, instead the emulation is provided by Windows. According to that doc, "Spaces embedded in strings may cause unexpected behavior", so it seems the answer to your question would be No. Hence the need for modules like Win32::ShellQuote.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1101006]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-23 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found