Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Windows viewpoint?-- Re^3: running programs from PERL

by jakobi (Pilgrim)
on Oct 25, 2009 at 14:43 UTC ( #803153=note: print w/ replies, xml ) Need Help??

in reply to Re^2: running programs from PERL
in thread running programs from PERL

With POSIX support I meant the libc and lower portions of POSIX and I was under the impression that e.g POSIX exec() was part of whatever was once enough to give Microsoft some claim of POSIX compatibility certifications for NT and later. Looks like I badly misremembered things.

My original question is the reverse of your example:

Can I e.g. set $ENV{VARIABLE} in a non-CYGWIN-port of Perl, and then use system q{dir "%VARIABLE%"} to have cmd.exe expand the variable? More specifically, what happens if the variable contains [\n \\;"']?

A new question/request:

What I'd love to do is appending a link to a node giving the comparable portable (or windows) version of $ENV{f}="a b; 'c'"; system q{dir "\$f"}.

Alternately at most a single concise paragraph as a footnote on the windows side of things to Re: *SAFE* use of string in system command.

Otherwise its a bit unfair if the Unix view hogs all the good keywords and doesn't help a windows SoPW :)

What I currently have - after some searching on PerlMonks - is a mess and a headache (and a bit of glee in lacking the windows environment to test this mess).

It reads like system/exec/(pipe-)open should be avoided on Windows for non-trivial commands, preferring IPC::System::Simple or Win32::Process::Create instead.

Do we have a better explanation or tutorial already on PerlMonks or do you know of a suitable resource outside?

cu & thanx, Peter -- hints may be untested unless stated otherwise; use with caution & understanding.

Comment on Windows viewpoint?-- Re^3: running programs from PERL
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2016-02-13 13:27 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (432 votes), past polls