i think it looks like the problem is the missing space between print and << .
Update : I was wrong. Per the below, the space is not needed. I did download and test this, and the code works fine on my Windows machine. (Win98/Cygwin Bash/ActiveState 5.6.1). What kind of machine was this runing on ?