There looks to be something wrong with the return value of the multiHandle's perform proc. If you tweak the test to add puts $running at line 13 you can see that it is does not print 1 and then 0 as you would expect. On a FreeBSD system it prints 8 and then 7, and on MacOS it prints 32711 and then 32710.