Elegant has asked for the wisdom of the Perl Monks concerning the following question:
The above is an example where I am able to reproduce the issue. I realize many people here will not be able to recreate the scenario (as you'll need MKVExtract and a MKV file with chapters) so I'll summarize. The above code is extracting an XML from the MKV then immediately loading it up with load_xml. 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"). I'm not sure how to work around the issue apart from using folders that contain no spaces. Below is the error. Any help would be greatly appreciated!use warnings; use strict; use XML::LibXML; my $mkvext = 'mkvextract'; my ($self) = {}; $self->{xml} = XML::LibXML->new(); my $item = "F:\\My Folder\\split-001.mkv"; my $cmd = "$mkvext chapters $item"; open my $H, "$cmd |"; binmode $H; my $xml = $self->{xml}->load_xml(IO => $H);
L:>Test.pl Entity: line 1: parser error : Document is empty Error: Unrecognized command line option 'Folder\split-001.mkv'. ^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Load XML issues
by Corion (Patriarch) on Sep 18, 2014 at 08:12 UTC | |
by Elegant (Novice) on Sep 18, 2014 at 16:37 UTC | |
|
Re: spaces in shell commands ( Win32::ShellQuote )
by Anonymous Monk on Sep 18, 2014 at 07:49 UTC | |
by salva (Canon) on Sep 18, 2014 at 08:02 UTC | |
by Discipulus (Canon) on Sep 18, 2014 at 08:07 UTC | |
by Anonymous Monk on Sep 18, 2014 at 17:32 UTC |