in reply to code does not work on HP

Have you tried #!/usr/bin/env perl or the HP equivelent?