in reply to remove multiple indexes from an array

You need to sort numerically on that second one:
sub splice_entry_2 { my @kills = sort { $a <=> $b } @_; local *ARGV; @ARGV = "shows.data"; while (<>) { if (@kills and $. >= $kills[0]) { shift @kills while @kills and $. >= $kills[0]; next; } print; } }

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Default sort behavior.
by thunders (Priest) on Dec 18, 2001 at 20:51 UTC
    Yikes!
    $ perl -e '@a =(1..20);for(sort @a){print "$_ "}' 1 10 11 12 13 14 15 16 17 18 19 2 20 3 4 5 6 7 8 9
    Thanks, Randal. That was a disaster waiting to happen.