in reply to Re: Redirecting OUTPUT of system($command) to an array
in thread Redirecting OUTPUT of system($command) to an array
Otherwisemy $command = "/usr/local/some/command"; my $result = `$command`; my @array = split /\n/ , $result;
Cheers - L~R
Update: If the desired outcome is to split on newlines, then there is no need to store the result into a temporary scalar and split yourself as japhy points out below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Redirecting OUTPUT of system($command) to an array
by japhy (Canon) on May 13, 2004 at 18:38 UTC | |
|
Re^3: Redirecting OUTPUT of system($command) to an array
by Nkuvu (Priest) on May 13, 2004 at 19:23 UTC |