Fix syntax errors in ORDER BY docs (GH#7)
[scpubgit/Q-Branch.git] / lib / SQL / Abstract.pm
index 4017d64..596c589 100644 (file)
@@ -27,7 +27,7 @@ BEGIN {
 # GLOBALS
 #======================================================================
 
-our $VERSION  = '1.81';
+our $VERSION  = '1.81_01';
 
 # This would confuse some packagers
 $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
@@ -1419,7 +1419,7 @@ sub _quote {
 
 
 # Conversion, if applicable
-sub _convert ($) {
+sub _convert {
   #my ($self, $arg) = @_;
   if ($_[0]->{convert}) {
     return $_[0]->_sqlcase($_[0]->{convert}) .'(' . $_[1] . ')';
@@ -1428,7 +1428,7 @@ sub _convert ($) {
 }
 
 # And bindtype
-sub _bindtype (@) {
+sub _bindtype {
   #my ($self, $col, @vals) = @_;
   # called often - tighten code
   return $_[0]->{bindtype} eq 'columns'
@@ -2904,32 +2904,38 @@ script.
 =head1 ORDER BY CLAUSES
 
 Some functions take an order by clause. This can either be a scalar (just a
-column name,) a hash of C<< { -desc => 'col' } >> or C<< { -asc => 'col' } >>,
-or an array of either of the two previous forms. Examples:
-
-               Given            |         Will Generate
-    ----------------------------------------------------------
-                                |
-    \'colA DESC'                | ORDER BY colA DESC
-                                |
-    'colA'                      | ORDER BY colA
-                                |
-    [qw/colA colB/]             | ORDER BY colA, colB
-                                |
-    {-asc  => 'colA'}           | ORDER BY colA ASC
-                                |
-    {-desc => 'colB'}           | ORDER BY colB DESC
-                                |
-    ['colA', {-asc => 'colB'}]  | ORDER BY colA, colB ASC
-                                |
-    { -asc => [qw/colA colB/] } | ORDER BY colA ASC, colB ASC
-                                |
-    [                           |
-      { -asc => 'colA' },       | ORDER BY colA ASC, colB DESC,
-      { -desc => [qw/colB/],    |          colC ASC, colD ASC
-      { -asc => [qw/colC colD/],|
-    ]                           |
-    ===========================================================
+column name), a hashref of C<< { -desc => 'col' } >> or C<< { -asc => 'col' }
+>>, a scalarref, an arrayref-ref, or an arrayref of any of the previous
+forms. Examples:
+
+               Given              |         Will Generate
+    ---------------------------------------------------------------
+                                  |
+    'colA'                        | ORDER BY colA
+                                  |
+    [qw/colA colB/]               | ORDER BY colA, colB
+                                  |
+    {-asc  => 'colA'}             | ORDER BY colA ASC
+                                  |
+    {-desc => 'colB'}             | ORDER BY colB DESC
+                                  |
+    ['colA', {-asc => 'colB'}]    | ORDER BY colA, colB ASC
+                                  |
+    { -asc => [qw/colA colB/] }   | ORDER BY colA ASC, colB ASC
+                                  |
+    \'colA DESC'                  | ORDER BY colA DESC
+                                  |
+    \[ 'FUNC(colA, ?)', $x ]      | ORDER BY FUNC(colA, ?)
+                                  |   /* ...with $x bound to ? */
+                                  |
+    [                             |
+      { -asc => 'colA' },         | ORDER BY colA ASC, colB DESC,
+      { -desc => [qw/colB/] },    |          colC ASC, colD ASC,
+      { -asc => [qw/colC colD/] },|          colE DESC, FUNC(colF, ?)
+      \'colE DESC',               |   /* ...with $x bound to ? */
+      \[ 'FUNC(colF, ?)', $x ],   |
+    ]                             |
+    ===============================================================