As has been mentioned time without number elsewhere, if nothing else, you ought to...
- use strict;
- use warnings;
- Use the 3 argument variant of open
- Test the status returned from the call to open
That being said, you ...
- Attempt to slurp the file in one, but have forgotten local undef $/;.
- Fail to open OUTPUTFILE
A user level that continues to overstate my experience :-))