in reply to Here docs throwing syntax error - can't find string terminator

For here-doc terminators, leading blanks are whitespace is meaningful. Insert the same amount of blanks in your print statement leading delimiter, e.g.
use strict; my $stuff = join(":", <<" END" =~ /(.+)/g); hi there this\tis\ta\ttest of the best! END

or (better) remove the leading blanks from the end token.

update: strikes for better wording, and changed '        END' to "        END". Well...

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: Here docs throwing syntax error - can't find string terminator
by ikegami (Patriarch) on May 30, 2007 at 16:05 UTC

    You used 'END' where you should have used "END".

    print <<END, <<'END', <<"END"; abc\tdef END abc\tdef END abc\tdef END

    outputs

    abc def abc\tdef abc def

    <<END is equivalent to <<"END" and not equivalent to <<'END', so the OP needs <<"        END" rather than <<'        END'.