#!/usr/bin/perl -w use strict; &delete_entry(5,3,0); &splice_entry(5,3,0); sub delete_entry{ my @removes = @_; my $datafile = "shows.data"; open(GETDEL,$datafile)or die "Cannot open $datafile: $!"; my @rows = ; close(GETDEL); my @fulllist; for (my $index =0;$index < @rows ;$index++) { push @fulllist,$index,$rows[$index]; } my %fullhash =(@fulllist); for (@removes) { delete $fullhash{"$_"}; } my @keeplist = (values %fullhash); print @keeplist; } sub splice_entry{ my @kills = sort @_; my $datafile = "shows.data"; open(GETSPL,$datafile)or die "Cannot open $datafile: $!"; my @rows = ; close(GETSPL); my $decr = 0; for(@kills){ splice(@rows,$_+$decr,1); --$decr; } print @rows; }