in reply to delete multiple occurrences

untested:
@anew = shrink(\@a, \@b); sub shrink { my %seen; my @ret; warn ("input arrays not the same length") unless scalar @{$_[0]} == scalar @{$_[1]}; for my $i ( 0..scalar @{$_[1]} ) { push @ret, $_[0]->[$i] unless $seen{$_[1]->[$i]}; $seen{$_[1]->[$i]} = 1; } return @ret; }


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: delete multiple occurrences
by BrowserUk (Patriarch) on Jan 13, 2009 at 05:49 UTC
      Yes, I just realized I misread the problem. Doesn't matter. First post get XP that or that way ;)


      holli, /regexed monk/