X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FUtils.pm;h=855d9a017afa9efad6603c2da454eda91033ada1;hb=11d8f9d0c3264e78ce0750ad110f6a7c699d9bc9;hp=8e31185836642f4030e6fe7991b9eb30f690affe;hpb=590f4d4a5203b2df337c98f4a00fe5bedace4b93;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Utils.pm b/lib/SQL/Translator/Utils.pm index 8e31185..855d9a0 100644 --- a/lib/SQL/Translator/Utils.pm +++ b/lib/SQL/Translator/Utils.pm @@ -1,7 +1,7 @@ package SQL::Translator::Utils; # ---------------------------------------------------------------------- -# $Id: Utils.pm,v 1.5 2003-05-12 14:49:39 kycl4rk Exp $ +# $Id: Utils.pm,v 1.6 2003-05-12 15:39:28 dlc Exp $ # ---------------------------------------------------------------------- # Copyright (C) 2003 darren chamberlain # @@ -116,11 +116,13 @@ HEADER_COMMENT } # ---------------------------------------------------------------------- -sub parse_list_arg { - return UNIVERSAL::isa( $_[0], 'ARRAY' ) - ? shift - : [ map { s/^\s+|\s+$//g; $_ } map { $_ ? split /,/ : '' } @_ ] - ; +sub parse_list_arg { + my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ]; + + return [ map { s/^\s+|\s+$//g; $_ } + map { split /,/ } + grep { defined } @$list + ]; } 1;