Can you reduce your script to something short that works on the other machines, but not on HP-UX, and post it, maybe? (Or post the whole thing here, if its not too long).
I have a couple of HP perls here, not self-built though. Where did you build them from? And which perl version?