No such thing as a small change | |
PerlMonks |
Re: Special Variables and Multiple Regexp Matchingby LanX (Saint) |
on Nov 18, 2013 at 00:30 UTC ( [id://1063023]=note: print w/replies, xml ) | Need Help?? |
I'm not sure what your goal is... We have to guess how '$token' and '$line' look like, and I have no idea why the (undemonstrated) while loop should not terminate.¹ (see How (Not) To Ask A Question and How do I post a question effectively?) But pos will tell you where the last match paused, the rest should be easily calculated with 'length($token)' (IF token is just a simple string)
update¹) well except the fact that lc always creates a new string which resets the search-position. Simply lowercase once '$line' before you loop!
Cheers Rolf ( addicted to the Perl Programming Language)
In Section
Seekers of Perl Wisdom
|
|