in reply to Re: Look ahead and join if the line begins with a +
in thread Look ahead and join if the line begins with a +

Kudos japhy
Your simplistic takes home the prize.. but you forgot to remove \n..
@cleanet = scalar <NETLIST>; while (<NETLIST>) { if (s/^\+// or s/^\*\+//) { $cleanet[-1] =~ s/\n/ /; $cleanet[-1] .= $_ } else { push @cleanet, $_ } }
Thanks so much, now how do I get this back to where I started from.. After 80 characters and NOT on a word(something separated with a space) break it into two lines and put back the "+"?
Thanks again.

Replies are listed 'Best First'.
Re: Re: Re: Look ahead and join if the line begins with a +
by petral (Curate) on Apr 11, 2002 at 19:06 UTC
    Of course, that simplifies to   $cleanet[-1] =~ s/\n/ $_/;,  but see merlyn's solution below.

      p