in reply to remove multiple indexes from an array


The hash example seems a little convoluted. So I guess that the splice example is better.

Alternatively it might be better to drop the unwanted lines when you are reading the data:

sub new_splice { my @kills = @_; my $datafile = "shows.data"; open(GETSPL, $datafile) or die "Cannot open $datafile: $!"; my @rows; while (<GETSPL>) { # Only store the lines not listed in @kills push @rows, $_ unless grep {$_ == $. -1} @kills; } close(GETSPL); print @rows; }

--
John.