On Jun 9, 7:17 pm, pengyu...@gmail.com (Peng Yu) wrote: > I can't find an existing perl subroutine (in the library) to find > every occurrence of a substring in a string. The following webpage > "Example 3b. How to find every occurrence" uses a loop to do so. But > I'd prefer a subroutine. Could you let me know if such a subroutine is > available in perl library? > > http://perlmeme.org/howtos/perlfunc/index_function.html >
Not that I know of but you write your own subroutine using the index code you've shown. Nearly trivial to do and, after all, plagiarism is a virtue :) -- Charles DeRykus -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/