Welcome to the Monastery | |
PerlMonks |
Re: Store multiple linesby johngg (Canon) |
on Feb 09, 2018 at 14:41 UTC ( [id://1208834]=note: print w/replies, xml ) | Need Help?? |
If it is safe to assume that the "service-name" line immediately follows the "static-route" line, and the file is not huge, then I might read all of the data into a scalar then remove the \nxxxxxxxx- parts globally so that all the information for each item was on one line. That would remove the need for the logic of two separate regex matches simplifying the data extraction. I would then open a reference to the scalar and read that line by line. Something like:-
I hope this is helpful. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|