Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have this cgi that I build a sql statement in, pass to dbi and do stuff with the results. I want to make the code readable but the following complains if I indent the ending tag.
$sql = <<EOSQL; update employee set fname = '$NS::fname', lname = '$NS::lname', team = '$NS::team' EOSQL >- script complains if this is indented.
Why does EOSQL have to be in column 0 for the above assignment to work? Why can't it just read till it sees EOSQL?
TIA
Travis
2001-03-03 Edit by Corion : Changed PRE to CODE tags, fixed heredoc syntax.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why does $sql = EOSQL; require EOSQL to be in column 0?
by yakko (Friar) on Feb 23, 2001 at 00:39 UTC | |
|
Re: Why does $sql = EOSQL; require EOSQL to be in column 0?
by dws (Chancellor) on Feb 23, 2001 at 00:40 UTC | |
by dvergin (Monsignor) on Feb 23, 2001 at 00:55 UTC | |
by chipmunk (Parson) on Feb 23, 2001 at 08:33 UTC |