in reply to what does $|++ do here?

This is a classic example of where a single Perl comment preceding this cryptic statement would have been extraordinarily helpful to more-than-a-few someones.   When I read source-code, what I most want to get a glimpse of is:   the original writer’s intentions, whether the resulting code be clever or not.   I can always use perldoc or RTFM™ to figure out what you wrote, but what takes so much time is understanding why you wrote it.   (Even in the case of your own code, which, months or years later, has become the work of a stranger.)