in reply to Why does $sql = <<EOSQL; require EOSQL to be in column 0?

To indent, try
$sql = <<" EOSQL"; ... EOSQL
Alternatively, you can break at the first blank line by doing
$sql = <<""; update employee set ...
Though that's a bit controversial to some.

Also, I suggest that you consider using bind parameters in the query. E.g.,

update employee set fname = ?, lname = ?, team = ?
and then pass the bindings to execute().

Replies are listed 'Best First'.
Re: Re: Why does $sql = EOSQL; require EOSQL to be in column 0?
by dvergin (Monsignor) on Feb 23, 2001 at 00:55 UTC
    Whenever you have variables in your heredoc, you will want to use double quotes in the example dws suggests. Otherwise the here doc will be single-quotish and the variables will not interpolate:
    $sql = <<" EOSQL"; ... EOSQL
    This technique breaks of course if you change the indenting on the heredoc itself without changing the indent on the '<<' line. So you will need to decide if the readability is sufficient advantage to make up for the maintenance issue.
      FYI, if you leave off the quotes around your here-doc terminator, then you get the double-quotish, not single-quotish, behavior. To get a single-quotish here-doc, you have to explicitly use single quotes.
      $name = 'Bob'; my $text = <<EOT; Hello, $name! EOT print $text;