in reply to (MeowChow) Re2: Look ahead and join if the line begins with a +
in thread Look ahead and join if the line begins with a +
Ahmm
# vulgar AND broken my @lines; $lines[@lines - s/^\+//] .= $_ while <DATA>; print @lines __DATA__ This +is +supposed +to +be +one +line! Oops
I'm sure that this is what you meant, but even this is broken as it will possibly remove the last char in the file if their is no trailing newline.
$lines[@lines - s/^\+//] .= substr $_,0,-1 while <DATA>;
This will work:
$lines[ @lines + 1 - s -^\053|\012--g ] .= $_ while <DATA>;
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(MeowChow) Re4: Look ahead and join if the line begins with a +
by MeowChow (Vicar) on Apr 11, 2002 at 09:40 UTC | |
by tachyon (Chancellor) on Apr 11, 2002 at 10:06 UTC | |
by MeowChow (Vicar) on Apr 11, 2002 at 10:11 UTC |