Revision 67223abf
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/MoreCommon.pm | ||
---|---|---|
4 | 4 |
@ISA = qw(Exporter); |
5 | 5 |
|
6 | 6 |
@EXPORT = qw(save_form restore_form compare_numbers any cross); |
7 |
@EXPORT_OK = qw(ary_union ary_intersect ary_diff); |
|
7 |
@EXPORT_OK = qw(ary_union ary_intersect ary_diff listify);
|
|
8 | 8 |
|
9 | 9 |
use YAML; |
10 | 10 |
|
... | ... | |
159 | 159 |
return grep { !$in_b{$_} } @$a; |
160 | 160 |
} |
161 | 161 |
|
162 |
sub listify { |
|
163 |
my @ary = scalar @_ > 1 ? @_ : ref $_[0] eq 'ARRAY' ? @{ $_[0] } : (@_); |
|
164 |
return wantarray ? @ary : scalar @ary; |
|
165 |
} |
|
166 |
+ |
|
167 |
|
|
162 | 168 |
1; |
Auch abrufbar als: Unified diff
Funktion "listify" ergänzt.
Merge aus -r9498 intern.