help with qx?

Uri Guttman uri at stemsystems.com
Wed Feb 6 02:15:17 GMT 2008


>>>>> "RJR" == Randy J Ray <rjray at blackperl.com> writes:

  RJR> If you use it in a list context, you will get a list of lines
  RJR> rather than one big string. However, you won't be able to process
  RJR> it in an "async" sort of manner. The command will run to
  RJR> completion as part of creating the list that you then iterate
  RJR> over. So you'll still have used the same amount of memory.

and it will be unlikely that his command will generate enough output to
fill a stdio buffer in the qx or the open pipe. so looping over the qx
lines in a list context or reading line by line from the open pipe will
be about the same speed and storage. i would lean to the qx as it is
slightly simpler to code up. the open pipe has the issue of getting the
exit status from the close call which is easy to screw up or forget.

uri

-- 
Uri Guttman  ------  uri at stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Architecture, Development, Training, Support, Code Review  ------
-----------  Search or Offer Perl Jobs  ----- http://jobs.perl.org  ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


More information about the london.pm mailing list