perlport has some good information on things that don't work consistently between Perl platforms.
Nothing in your code immediately stands out as Not Working. I would recommend you give us an exact error message when running under -w and strict for better answers.