in reply to Simple regex gone wierd

In your foreach loop, on a successful match, you empty line. The next pass through the foreach loop, you're going to fail to match ^%%+ and thus return.

The fix is to put a last after the print "Killed media type: $media\n". Once you've killed, after all, you needn't bother with more checking.

Alternatively, and probably better, is to put the check for ^%%+ before the foreach loop.


The PerlMonk tr/// Advocate