my @exclude = (2,5..8); my @exclude_lkup; $exclude_lkup[$_] = 1 for @exclude; my $line = "1!2!3!4!5!6!7!8!9"; my @arr = split /!/, $line; my @filtered = map $arr[$_], grep !$exclude_lkup[$_], 0..$#arr; print("@filtered\n"); # 1 2 4 5
In reply to Re^3: Splicing Arrays on pre-defined indices
by ikegami
in thread Splicing Arrays on pre-defined indices
by harishnuti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |