I'm having a problem that if I do a match on the same pattern in a row it will not match on every other one. This is my test code. $line = "this is a test of a weird problem"; print "A\n"; if ($line =~ m/test/g) { print "I'm here A\n"; } print "B\n"; if ($line =~ m/test/g) { print "I'm here B\n"; } print "C\n"; if ($line =~ m/test/g) { print "I'm here C\n"; } print "D\n"; if ($line =~ m/test/g) { print "I'm here D\n"; } print "E\n"; if ($line =~ m/test/g) { print "I'm here E\n"; } print "F\n"; if ($line =~ m/test/g) { print "I'm here F\n"; } print "G\n"; if ($line =~ m/test/g) { print "I'm here G\n"; } print "H\n"; if ($line =~ m/test/g) { print "I'm here H\n"; } The output I get is: A I'm here A B C I'm here C D E I'm here E F G I'm here G H The output should be: A I'm here A B I'm here B C I'm here C D I'm here D E I'm here E F I'm here F G I'm here G H I'm here H thanks, Ricardo Muggli ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org