from rt branch perl-5.18-compat, http://www.gossamer-threads.com/lists/rt/commit/117511