Today I learned a variation of HERE-docs syntax I didn't know about before:
print <<; text text text text text text
print <<''; text text text text text text
That first one sure looks weird. I can't justify calling it a bug, but perldata clearly states
While I could argue thatFollowing a << you specify a string to terminate the quoted material...
''
is a legitimate string, I can't say the same for. (See that null string just before the period?)
Re:Wow
IlyaM on 2003-07-15T15:18:12
It is documented in perlop:Following a "<<" you specify a string to terminate the quoted material, and all lines following the current line down to the terminating string are the value of the item..... There must be no space between the "<<" and the identifier, unless the identifier is quoted. (If you put a space it will be treated as a null identifier, which is valid, and matches the first empty line.)
Re:But wait! There's more!
dws on 2003-07-15T15:29:46
Arg. Make that print <<''; and print <<"";