Sigh.
I didn't ask for your complete existing script. I was asking
for a cut-down version of it that is the minimum that reproduces the problem; then I might be able to reproduce the problem here. And if its a problem with Perl, I could get to fixed for 5.8.5. Just for the record, I think its highly unlikely to be a GCC bug.
My reference to non-core modules meant that it would be great if the sample script only relied on core modules (such as Socket), but didn't rely on non-core modules which I would have to separately downlaod and install to be able to reproduce the problem here.