There is something wrong with whatever text editor you used to create that file. It has hidden characters in it.
I retyped your test file and named it test.pl, it now executes fine with an exact copy of your code.
http://arun.x10hosting.com/cgi-bin/test.pl
-Corey