Perl-Sensitive Sunglasses | |
PerlMonks |
Re: store rest of the lines in a array after a matching pattern is foundby roboticus (Chancellor) |
on May 17, 2018 at 17:29 UTC ( [id://1214767]=note: print w/replies, xml ) | Need Help?? |
You don't specifically ask a question, but since you say "rest of the line", I'm guessing your problem is that you're printing too much after "my string". I'd suggest changing your regular expression to:
which will, if the expression matches, put the rest of the line (i.e., the stuff after the '=') into the $1 capture buffer. From there you could extract the stuff you're interested in, like so:
Notes:
...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|