The program I gave you was incorrect. It should have been
perl -0777nE"BEGIN { binmode STDIN }; say unpack 'H*', $_" <foo.pl
But it still revealed the problem. Your lines are terminated by carriage returns (0D) instead of CRLF (0D0A)!
2321633a2f7065726c2f62696e2f7065726c2e6578650d
0d
757365207374726963743b0d
757365207761726e696e67733b0d
0d
7072696e742022666f6f5c6e223b0d
0d
To Perl, that's all one line. That's right, your entire program is a very long shebang line.
Switch from MacOS line endings (a machine that was obsolete 10 years ago) to Windows lines endings, and your problem should go away.