help with qx?
iainspeed at gmail.com
Wed Feb 6 13:42:53 GMT 2008
On 6 Feb 2008, at 7:11 am, Uri Guttman wrote:
>>>>>> "RJR" == Randy J Ray <rjray at blackperl.com> writes:
>>> 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.
> RJR> He did specifically say that he expected the command to
> RJR> a considerable amount of output. I suppose that depends on
> RJR> whether his concept of "considerable" matches ours. Pulling
> RJR> diffs or log history on a sizable project could produce fairly
> RJR> large output.
> if that is the case then open | will be more efficient. but with
> ram and buffer sizes, even 1Mb is small. we haven't been told the
> size but if it is < 1MB (or even more given the ram available) then
> buffering will not matter much. so again, simpler coding should win
> and qx is simpler than open |.
> 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
I'm quite embarrassed to say it ended up being approx 250k... (gets
In my defence, the buffer on the Windows command terminal was so
small that I couldn't tell how much there was - it looked like a lot
more than that! :) Still, could be a lot more output depending on
what is checked out, but you're probably both right about the power
of the machines etc.
I ended up using a pipe because it still printed to STDOUT with a
filehandle. Once I got it working I just left it as is.
More information about the london.pm