help with qx?

Nicholas Clark nick at ccl4.org
Wed Feb 6 00:51:20 GMT 2008


On Wed, Feb 06, 2008 at 12:39:20AM +0000, Iain Barnett wrote:

> (a.k.a C# developers) waiting for a script to cure their build process!

There would be some reason why they don't want to write this in C#? :-)

> The script has a system call (to the svn command-line client), and it  
> could possibly return a lot of lines back so I don't want to store it  
> in an array, but process it as it's coming through. Is there a way to  
> force qx or `` into list context, or something equally helpful?
> 
> e.g
> 
> while( list qx($command) ) {
> 	do stuff...
> }
> 
> 
> Any help is much appreciated!

something like this?

open my $fh, '-|', $command or die $!;
while (<$fh>) {
	do stuff ...
}
close $fh or die $!;

(untested, and I'm not sure if $! is the most useful thing for diagnostics.
But you want to use open)

Nicholas Clark


More information about the london.pm mailing list