The attempts thing is weird, and I don't understand why the forking fails so often (although usually just once). That said, here's the documentation which recommends this implementation:

[perldoc interprocess communication](http://perldoc.perl.org/perlipc.html) (^f Safe Pipe Opens)

They're using 6, but they're sleeping between iterations, which I don't have the patience for :-) so I bumped it up a bit to be safe. It seems arbitrary to me. In practice, it very consistently returns successfully on the second attempt.

Anyway, I agree, it's worth comments. I'll clean up a little bit, fix the double-installdeps-attempt bug I mentioned earlier, and explain the reasoning inline.

As for testing, I'll take a look at it, but I'm worried that won't be simple or even maybe possible, because cpan/m do not support uninstallation of modules. Do you have any ideas for how to approach a test for this?