patch from Chris Dolan via rt.cpan.org #30631