On Thu, Nov 14, 2002 at 02:21:35PM +1100, Ken Williams wrote:
> >@@ -1084,12 +1097,18 @@
> >         print "Checking $abs\n" if ($trace >= 2);
> >         next unless $self->maybe_command($abs);
> >         print "Executing $abs\n" if ($trace >= 2);
> >-        $val = `$abs -e 'require $ver; print "VER_OK\n" ' 2>&1`;
> >-        if ($val =~ /VER_OK/) {
> >+
> >+            # To avoid using the unportable 2>&1 to supress STDERR,
> >+            # we close it before running the command.
> >+            close STDERR if $stderr_duped;
> >+            $val = `"$abs" -e "require $ver; print qq{VER_OK\n}"`;
> >+            open STDERR, '>&STDERR_COPY' if $stderr_duped;
> 
> Is there no way to use the multi-arg system() to avoid these 
> quoting issues altogether?

Ed's original patch tried that.
http://archive.develooper.com/makemaker@;perl.org/msg00199.html

As you can see its more work and involves temp files (Ed's patch forgets to
cleanup after itself).  And its incomplete since it would have to read the
output from the file to which STDOUT was redirected to make sure the VER_OK
was printed rather than just relying on the exit value as the more modern
version of find_perl() does. [1]

If there was a multi-arg version of `` that would solve the problem, except
we wouldn't be able to use it because it would require a Perl upgrade. :(


[1] Consider /bin/true -e "require 5.6"

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
The key, my friend, is hash browns.
        http://www.goats.com/archive/980402.html

Reply via email to