Hello
Say you obtained the output using the backticks:
$str = `(timex ps -ef > /dev/nul) 2>&1`;
then just
$str =~ s/^\s+//; # remove the first line
%timex = split(/\s+/, $str);
print "$_: $timex{$_}\n" for keys %timex;
will output:
real: 0.00
user: 0.00
sys: 0.00
(order is not preserved, but not important anyways).
Hope this helps
Aziz,,,
On Wed, 20 Jun 2001 12:33:09 -0400, Yacketta, Ronald said:
> I have been looking for a little regex that would remove NULL (blank) lines
> from input.
> I have a little script that parses the output of timex (unix), unfortuanly
> the timex output
> is prepended with a blank line and appended with a blank line as such
>
> (timex ps -ef > /dev/nul) 2>&1
>
> [begin output]
>
> real 0.00
> user 0.00
> sys 0.0
>
> [end output]
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com