$ cat 11144614.pl #!/usr/bin/env perl use warnings; use strict; my $hfile = 'foo.txt'; # GOOD open(HFILE, '>', $hfile) or die "$hfile: $!"; print HFILE << "#EOT"; #Usage: foo.pl #EOT # BAD open(my $HFILE, '>', $hfile) or die "$hfile: $!"; print $HFILE << "#EOT"; #Usage: foo.pl #EOT # GOOD open($HFILE, '>', $hfile) or die "$hfile: $!"; print {$HFILE} << "#EOT"; #Usage: foo.pl #EOT $ perl 11144614.pl Argument "#EOT" isn't numeric in left bitshift (<<) at 11144614.pl line 15. 10294240 $ perl -MO=Deparse,-p 11144614.pl use warnings; use strict; (my $hfile = 'foo.txt'); (open(HFILE, '>', $hfile) or die("${hfile}: $!")); print(HFILE "#Usage: foo.pl\n"); (open(my $HFILE, '>', $hfile) or die("${hfile}: $!")); print(($HFILE << '#EOT')); (open($HFILE, '>', $hfile) or die("${hfile}: $!")); print({$HFILE;} "#Usage: foo.pl\n"); 11144614.pl syntax OK