From: Matt S Trout Date: Sun, 13 Oct 2019 04:24:23 +0000 (+0000) Subject: handle empty but defined sep correctly X-Git-Tag: v1.90_03~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=062df19a07702ff179a58047096e856cf55f8c8b;p=dbsrgits%2FSQL-Abstract.git handle empty but defined sep correctly --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 4954643..3313081 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1284,8 +1284,11 @@ sub _expand_ident { unless (defined($body) or (ref($body) and ref($body) eq 'ARRAY')) { puke "-ident requires a single plain scalar argument (a quotable identifier) or an arrayref of identifier parts"; } - my @parts = map split(/\Q${\($self->{name_sep}||'.')}\E/, $_), - ref($body) ? @$body : $body; + my ($sep) = map +(defined() ? $_ : '.') , $self->{name_sep}; + my @parts = map +($sep + ? map split(/\Q${sep}\E/, $_), @$_ + : @$_ + ), ref($body) ? $body : [ $body ]; return { -ident => $parts[-1] } if $self->{_dequalify_idents}; unless ($self->{quote_char}) { $self->_assert_pass_injection_guard($_) for @parts;