} elsif (ref($arg) eq 'REF' and ref($$arg) eq 'ARRAY') {
$dq->{by} = $self->_literal_to_dq($$arg);
} elsif (ref($arg) eq 'SCALAR') {
- if (my ($ident, $dir) = $$arg =~ /^(\w+)(?:\s+(desc|asc))?/i) {
+ if (my ($ident, $dir) = $$arg =~ /^(\w+)(?:\s+(desc|asc))?$/i) {
$dq->{by} = $self->_ident_to_dq($ident);
$dq->{reverse} = 1 if $dir and lc($dir) eq 'desc';
} else {