On 28 August 2011 21:49, Father Chrysostomos <perlbug-followup@perl.org> wrote: > $ perl5.14.0 -Xle 'for(1,2) { print "a" =~ ?a? }' > 1 > > $ perl5.14.0 -Xle 'for(1,2) { print "a" =~ ?a?; reset "" }' > 1 > 1 > > The documentation for reset() says that it resets ?? matches if there is no > argument. It says nothing about an empty string. If anyone is using > reset($string), and if $string is computer-generated, this could cause nasty > surprises. > > Even though it’s generally better to make docs conform to longstanding > behaviour, too strict a stand would prevent any bugs from being fixed. And > this one really does look like a bug to me. My understanding of the docs is that reset *always* resets the ?? matches, and also any package variable beginning with the given list of characters. So the current behaviour matches the docs. On a related note, maybe it's time to deprecate arguments to reset ? -- It is always possible to aglutenate multiple separate problems into a single complex interdependent solution. In most cases this is a bad idea. -- RFC 1925Thread Previous