Sometimes minimal matching can help a lot. Imagine you’d like to match everything between "foo" and "bar". Initially, you write something like this: $_ = "The food is under the bar in the barn."; if ( /foo(.*)bar/ ) { print "got <$1>\n"; } Which perhaps unexpectedly yields: got That’s because ".*" was greedy, so you get everything between the first "foo" and the last "bar". Here it’s more effective to use minimal matching to make sure you get the text between a "foo" and the first "bar" thereafter. if ( /foo(.*?)bar/ ) { print "got <$1>\n" } got