X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/46e1506b7ccd09f451b1c33f9b42f450b96f55fd..2ef92b3a7c4b46a3eba1d41267fd0b8b413c49bd:/SL/MoreCommon.pm diff --git a/SL/MoreCommon.pm b/SL/MoreCommon.pm index e09d7c85d..6c292bab8 100644 --- a/SL/MoreCommon.pm +++ b/SL/MoreCommon.pm @@ -4,7 +4,7 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(save_form restore_form compare_numbers any cross); -@EXPORT_OK = qw(ary_union ary_intersect ary_diff); +@EXPORT_OK = qw(ary_union ary_intersect ary_diff listify); use YAML; @@ -159,4 +159,10 @@ sub ary_diff { return grep { !$in_b{$_} } @$a; } +sub listify { + my @ary = scalar @_ > 1 ? @_ : ref $_[0] eq 'ARRAY' ? @{ $_[0] } : (@_); + return wantarray ? @ary : scalar @ary; +} ++ + 1;