+ my (@lists, @max);
+ for my $arg (@_) {
+ next unless defined $arg;
+ my $type = ref $arg;
+ my $list;
+ if ($type eq 'ARRAY') {
+ $list = $arg;
+ } elsif ($type eq '') {
+ $list = [ 1 .. $arg ];
+ } else {
+ die "Invalid argument of type $type";
+ }
+ my $max = @$list;
+ die "Empty list" unless $max;
+ push @lists, $list;
+ push @max, $max;
+ }
+