For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2005 > how to handle multiline feedback from backticksoperator?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to handle multiline feedback from backticksoperator?
Bastian Angerstein

2005-02-23, 8:55 am



Hello there,

I have a cmd-PRogramm which produce multiline output.

/usr/testdrive.

I call this proggi from perl:

`/usr/testdrive -e -k | grep "/home"`;

This programm produce multiline Output,
how do I get this into a variable or array ?
John W. Krahn

2005-02-23, 8:55 am

Bastian Angerstein wrote:
>
> Hello there,


Hello,

> I have a cmd-PRogramm which produce multiline output.
>
> /usr/testdrive.
>
> I call this proggi from perl:
>
> `/usr/testdrive -e -k | grep "/home"`;
>
> This programm produce multiline Output,
> how do I get this into a variable


my $variable = `/usr/testdrive -e -k | grep "/home"`;

> or array ?


my @array = `/usr/testdrive -e -k | grep "/home"`;

Or:

my @array = grep m|/home|, `/usr/testdrive -e -k`;



John
--
use Perl;
program
fulfillment
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com