http://www.perlmonks.org?node_id=616597


in reply to Re^2: Strange regex to test for newlines: /.*\z/
in thread Strange regex to test for newlines: /.*\z/

Fair enough, but try:
perl -e 'print "match\n" if "foo\n" =~ /.{0,}\z/'
AFAIK, .* and .{0,} should be exactly equivilent, but when combined with /z they are not, if the string ends in a newline.

There definitely appears to be a bug here, but it may be that the above snippet should not match, rather than the version with .* matching.