Re: Invalid Operating System

[prev] [thread] [next] [lurker] [Date index for 2006/12/18]

From: tmtm
Subject: Re: Invalid Operating System
Date: 16:51 on 18 Dec 2006
On Mon, Dec 18, 2006 at 12:26:14PM +0000, Earle Martin wrote:
> On 17/12/06, H.Merijn Brand <h.m.brand@xxxxxx.xx> 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



There's stuff above here

Generated at 22:02 on 27 Dec 2006 by mariachi 0.52