in reply to Extract Block Of Text From Log
> I must be missing something simple
My guess:
the flip/flop op is nice if you are reading single lines, but you are swalling whole records, since you changed the $/ separator.
You either need to apply a multiline-regex or you re-open the record-string from IN to read line by line in order to apply the flip/flop. NB: It's possible to open from a scalar-ref \$chunk . °
Though most people would probably nest flip-flops:
- One to define the record
- a nested one to read the part you wanted.
TIMTOWTDI :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
°) doh, GrandFather's solution to simply split on "\n" is indeed easier! :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Extract Block Of Text From Log
by LanX (Saint) on Nov 20, 2018 at 22:44 UTC |
In Section
Seekers of Perl Wisdom