in reply to Re: Pattern Searching
in thread Pattern Searching

I appreciate your efforts in solving the problem. your code have the same problem i.e. works well for the 1st iteration, foreach loop of $string then it shows only first letter of patterns for rest of strings.

Replies are listed 'Best First'.
Re^3: Pattern Searching
by marquezc329 (Scribe) on Nov 10, 2012 at 11:20 UTC

    I figured as much. The snippet wasn't intended to debug, merely to give an example rewrite implementing some of the stylistic points I mentioned.

    I'd suggest taking a look at perldebtut. Using the Perl debugger to step through your code may help you visualize the flow of your program through each control structure, and figure out where it may be exiting prematurely on the 2nd and 3rd iteration.