in reply to Re: Re: Matching over multiple lines in a scalar
in thread Matching over multiple lines in a scalar
Take it one step further still and do away with the temporary scalar. This works.
my %lines = do{local$/; <DATA> = ~m/(?:^|\n)(\d+)\:(.+?)(?=(?:\n\d)|$) +/gs };
Now I'll wait for sauoq to reduce the regex to 3 chars and a twiddle and we've got a golf solution.:^)
Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy
| Replies are listed 'Best First'. | |
|---|---|
|
4Re: Matching over multiple lines in a scalar
by thpfft (Chaplain) on Oct 28, 2002 at 00:03 UTC |