Re: catch the output of an app in a perl script
"Michael" == Michael Naumann <firstname.lastname@example.org> writes:
Michael> On Friday 06 December 2002 12:56, Colin Watson wrote:
>> On Fri, Dec 06, 2002 at 12:35:08PM +0100, Raffaele Sandrini
>> wrote: > How can i catch the output of a program runned in a
>> perl script?
>> Use the "pipe open" syntax. The perlopentut man page will help.
Michael> Or even easier, use $output = `cmd`; or @output = `cmd`;
It's been some years since I've done real perl programming (thank God
for Python!), but the original poster might find it interesting that
the "pipe open" syntax allows the program to read the output when it
is ready. The backquotes require that the program have enough memory
to collect the program output at one time. If there is a lot of
output, that might be worth thinking about.
Or have I completely forgotten perl?