On Mon, Mar 11, 2002 at 06:08:20PM +0000, Edward Avis wrote:
> On Mon, 11 Mar 2002, Michael G Schwern wrote:
> 
> >         print "Executing $abs\n" if ($trace >= 2);
> >         $val = `$abs -e "require $ver;" 2>&1`;
> >
> >Using system() might be tricky because we need the result.
> 
> Result?  system() gives you the exit status of the process.  You can
> capture stdout and stderr with a bit of redirection:
> open(OLDERR, '>&STDERR') etc etc.  An example of this is included in
> perlfunc(1).

Last time I tried something like that it didn't work, unless I was
doing something really silly.  I was in an airport IIRC.... I was
probably doing something silly.


> The only safe and portable way to do this is the multi-argument form of
> system().  That is guaranteed to work no matter what the shell gets up
> to and no matter what weird characters appear in filenames.  Apart from
> ASCII NUL of course :-).

Try It!  find_perl() in ExtUtils::Win32 (the code above).  Gimme a
patch.


> It might be a good idea to make the code taint-clean, that makes sure
> you track down all places where weird characters in filenames can cause
> problems.  Which is overkill for an ordinary program, but perhaps
> necessary for something cross-platform like MakeMaker.

Yes.  After that we'll be unifying Gravity and Electromagnetism and
then World Peace will be brought about just after supper. :)

Take it slow.  MakeMaker is a mess and its not even properly tested.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Woah, like, did anybody see my watch?

Reply via email to