On Mon, Dec 18, 2006 at 12:26:14PM +0000, Earle Martin wrote:
> On 17/12/06, H.Merijn Brand <h.m.br...@xs4all.nl> wrote:
>> 1. It is not the same, as now the semi-colon is included in the
>> statement
>
> OH NOES TEH SEMI COLON!!1
>
> So take it out.

Ah, but the entire point was that if you use this idiom the semi-colon
allows you you to cut'n'paste into your favourite SQL execution
environment, but doesn't get passed through when called from Perl.

> I would note that in the code you pasted, it wasn't immediately
> obvious that the semi-colon isn't included in the statement, and that,
> my friend, is extremely hateful.

I thought it was rather nice myself. It might confuse people on first
encounter, but no more so than an empty string heredoc, which I find
equally hateful/nice:

my $sth = $dbh->prepare(<<'');
  select foo, bar
  from   baz
  where  duh = ?

$sth->execute(...);

Tony


Reply via email to