print << "ENDTAG"; # works print << 'ENDTAG'; # works print << ENDTAG; # syntax error! #### print "printing here doc:\n"; print <<"ENDTAG"; This text has 0 leading spaces This text has 4 leading spaces ENDTAG OUTPUT: printing here doc: This text has 0 leading spaces This text has 4 leading spaces #### { print "printing here doc:\n"; print <<"ENDTAG"; This text has 0 leading spaces This text has 4 leading spaces ENDTAG } #### { print "printing here doc:\n"; print <<" ENDTAG"; This text has 4 leading spaces ENDTAG } OUTPUT: printing here doc: This text has 4 leading spaces