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 ?
Oops, uploaded the wrong fragment. I tested with an explicit file handle and without. Although for the sake of completeness I guess I should leave both up
#! /usr/bin/perl -w
use strict;
print<<text;
foo
bar
text