sub pjotrik { my ($a, $b) = @_; my $i = 0; return [ map { if ($i < @$b && $_ == $$b[$i]) { $i++; () } else { $_ } } @$a ]; }