0

While practicing I found that the following code is working fine on Linux but not on Windows

print<<EOF;
this is a paragraph
EOF

On Windows it says.

Can't find string terminator "EOF" anywhere before EOF at demo.pl.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
nikhil mehta
  • 972
  • 15
  • 30

1 Answers1

1

Windows thinks the end of file is part of the terminating string EOF, thus it doesn't follow the rule that The terminating string must appear by itself. You need to add a new line after the terminating string EOF.

print<<EOF;
this is a paragraph
EOF
# a new line
Yu Hao
  • 119,891
  • 44
  • 235
  • 294