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