SQL call formatting style

Gervase Markham gerv at mozilla.org
Tue Apr 1 22:44:55 UTC 2003


David Miller wrote:
> On 3/29/03 10:39 PM +0000, Gervase Markham wrote:
> If I had to pick a preference, I'd go for the q{} stuff, personally. 

OK :-)

Revised proposal:

   my ($comma, $separated, $list, $of, $vars, $on, $one, $line) =
     $dbh->some_longwinded_methodname(q{SELECT some SQL variables
                                        ON multiple lines
                                        IF necessary
                                        WITH placeholders ?, ?, ?},
                                      undef,
                                      $placeholder, $variables, $here);

How's that look? The SQL block could be outdented if you need the room, 
and the placeholders could run onto a second line if necessary. I think 
this combines compactness with readability; it's also pretty like most 
of the calls currently in the code.

Gerv




More information about the developers mailing list