my @strings = ('a', 'b', 'c', 'd', 'e', 'f'); while (my $s = shift @strings) { print "Looking at $s\n"; my $value = $s =~ /a/ .. $s =~ /c/; print "The value is $value\n"; next if $value; print "$s is OK!\n"; }