$ perl -wle '"a" =~ /a/; // and print for qw( a b a b a b )' a a a #### $ perl -le 'print for a .. z' | perl -nle 'if (/d/ .. /h/) { print unless // }' e f g #### $ perl -le 'print for a .. z' | perl -nle 'if (/d/ .. /h/) { next unless //; print }' d f g h #### ... Matching REx "d" against "d" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [0..1] gave 0 Found anchored substr "d" at offset 0 (rx_origin now 0)... (multiline anchor test skipped) Intuit: Successfully guessed: match at offset 0 Matching REx "h" against "d" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [0..1] gave -1 Did not find anchored substr "h"... Match rejected by optimizer Matching REx "d" against "d" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [0..1] gave 0 Found anchored substr "d" at offset 0 (rx_origin now 0)... (multiline anchor test skipped) Intuit: Successfully guessed: match at offset 0 Matching REx "h" against "e" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [0..1] gave -1 Did not find anchored substr "h"... Match rejected by optimizer Matching REx "d" against "e" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [0..1] gave -1 Did not find anchored substr "d"... Match rejected by optimizer Matching REx "h" against "f" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [0..1] gave -1 Did not find anchored substr "h"... Match rejected by optimizer Matching REx "" against "f" (*) 0 <> | 0| 1:NOTHING(2) 0 <> | 0| 2:END(0) Match successful! ... #### $ perl -le 'print for a .. z' | perl -ne 'if (/d/ .. /h/) { next unless //; print }} continue {' d e f g h