Re: The "Right Way" (TM) to run external program out of gtk2-perl app?



* Stephan Brunner <stephan brunner gmx de> [2005-08-30 22:45]:
On Windows XP (ActiveState / 5.8.0), the usage of @cmd causes a
"List form of pipe open not implemented" error. Using

my $pid = open my $child, '-|', $cmd
             or die "can't fork convert: $!";

instead works fine, but filenames (containing blanks) must now
be quoted.

Ugh. Yeah, DOS/Win32 doesnât have a list of arguments, it only
has a single string.

Each program that wants a list has to parse that flat string
itself. This is, of course, because DOS filenames used to be 8+3,
with many characters disallowed, incl. spaces, so splitting on
spaces was enough, once upon a time.

Thatâs the kind of brokenness that happens when you try to grow
from toy to seriousâ

Something like

    open my $child, '-|', join( ' ', map qq["$_"], @cmd )

should work, I think, but I donât have a Windows box to test
with.

Regards,
-- 
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]