Problems? Is your data what you think it is? | |
PerlMonks |
Re: Parsing block of textsby kcott (Archbishop) |
on Apr 02, 2021 at 21:51 UTC ( [id://11130746]=note: print w/replies, xml ) | Need Help?? |
G'day perlance, Reading the entire file contents into a string, and then reading all of that data again to parse it, is not very efficent: instead, parse the data as you're reading it (once). I also think you're completely on the wrong track with '... split(/($pattern)/ ...'; to be honest, I'm not really sure what you were hoping to achieve with that. All you probably need is something simple like this:
Output:
— Ken
In Section
Seekers of Perl Wisdom
|
|