Thx for reply, let me make my question rather more simple
# Assume below line is read from a file
my @array = qw/i will skip some words here using splice/;
print "Array before deletion \n";
print join("-->",@array),"\n";
print "Enter the Indices which you like to skip\n";
chomp($indices=<STDIN>);
# i entered 2,4,5
my @indices = split(/\,/,$indices);
foreach (@indices){
splice (@array,$_,1); # remove element
}
print "Updated array is as below \n";
print join("==>",@array),"\n";
# if there is any easy way of doing above in short , i can integrate i
+n my existing code
|