projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff296f5
)
Funktion "listify" ergänzt.
author
Sven Schöling
<s.schoeling@linet-services.de>
Wed, 30 Sep 2009 10:40:42 +0000
(12:40 +0200)
committer
Sven Schöling
<s.schoeling@linet-services.de>
Wed, 30 Sep 2009 10:40:42 +0000
(12:40 +0200)
Merge aus -r9498 intern.
SL/MoreCommon.pm
patch
|
blob
|
history
diff --git
a/SL/MoreCommon.pm
b/SL/MoreCommon.pm
index
e09d7c8
..
6c292ba
100644
(file)
--- 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;