git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Convert open("-|") to qx{} calls

From
RDRogan Dawes <discard@dawes.za.net>
Date
Feb 24, 2006, 05:19 UTC
Message-ID
<43FE9771.4030206@dawes.za.net>
In-Reply-To
<20060223211403.GB5827@steel.home>
Alex Riesen wrote:
Show 13 quoted lines
> Randal L. Schwartz, Thu, Feb 23, 2006 21:41:44 +0100:
>> Johannes> Now that our local Perl guru joined the discussion, may I ask what
>> Johannes> is, and what is not quoted when put inside qx{}?
>>
>> Nothing is quoted.  Your string acts as if it was XXX in:
>>
>>         sh -c 'XXX'
>>
> 
> Not so for ActiveState. It'll just run the first non-whitespace word
> passing the rest of the line in its command-line.
> It's not even worse then to pass it all to cmd/command :)
> 
Not true.
 > type t
#!perl -w
print qx{echo joe & echo joe}."\n";
 > perl t
joe
joe
 >

If the shell was not interpreting the arguments, you would expect to get 1 line with:

joe & echo joe
on it.
 > perl -v
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 7 registered patches, see perl -V for more detail)
Copyright 1987-2005, Larry Wall

Binary build 813 [148120] provided by ActiveState http://www.ActiveState.com ActiveState is a division of Sophos. Built Jun 6 2005 13:36:37

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Regards,
Rogan
Previous: Randal L. SchwartzNext: Alex Riesen
Message 10 of 13 in “Convert open("-|") to qx{} calls”
  1. Convert open("-|") to qx{} callsJohannes Schindelin, Feb 23, 2006
  2. Alex RiesenFeb 23, 2006
  3. Randal L. SchwartzFeb 23, 2006
  4. Junio C HamanoFeb 23, 2006
  5. Randal L. SchwartzFeb 23, 2006
  6. Johannes SchindelinFeb 23, 2006
  7. Randal L. SchwartzFeb 23, 2006
  8. Alex RiesenFeb 23, 2006
  9. Randal L. SchwartzFeb 23, 2006
  10. Rogan DawesFeb 24, 2006
  11. Alex RiesenFeb 24, 2006
  12. Rogan DawesFeb 24, 2006
  13. Alex RiesenFeb 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.