package SL::MoreCommon;
require Exporter;
-@ISA = qw(Exporter);
+our @ISA = qw(Exporter);
-@EXPORT = qw(save_form restore_form compare_numbers any cross);
-@EXPORT_OK = qw(ary_union ary_intersect ary_diff);
+our @EXPORT = qw(save_form restore_form compare_numbers any cross);
+our @EXPORT_OK = qw(ary_union ary_intersect ary_diff listify);
use YAML;
use SL::AM;
+use strict;
+
sub save_form {
$main::lxdebug->enter_sub();
return grep { !$in_b{$_} } @$a;
}
+sub listify {
+ my @ary = scalar @_ > 1 ? @_ : ref $_[0] eq 'ARRAY' ? @{ $_[0] } : (@_);
+ return wantarray ? @ary : scalar @ary;
+}
+
1;