in reply to Re: parsing multi-line output from a cli command
in thread parsing multi-line output from a cli command

Re this bit:

elsif(s/^\s+//) { if(defined $ref->{summary}) { $ref->{summary} .= "\n$_"; } else { $ref->{summary} = $_; }

You can reduce it to:

elsif(s/^\s+//) { $ref->{summary} .= "\n$_"; }

dave

Replies are listed 'Best First'.
Re: Re: Re: parsing multi-line output from a cli command
by bart (Canon) on Jan 23, 2004 at 20:31 UTC
    Except now your summary will always start with a newline. Which is the reason for my elaborate scheme. :)

      Ooops! Hadn't thought of that :-( (ie that the OP might have wanted 'salagent' (whatever that means) on a new line.

      Good catch++. A lot of the other answers to this node need adjusting accordingly, if such is the case.

      dave