in reply to Inverse slices

That works. You could make it more terse, if you wanted:
my @array = ('aa'..'zz'); my %slice_idx = map( ($_ => 1), 6,13,42,66,69 ); my @invslice = @array[ grep ! exists $slice_idx{$_}, 0..$#array ];
Or use Array::Set, or Set::Array, or Set::Scalar.
--
A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |

Replies are listed 'Best First'.
Re^2: Inverse slices
by choroba (Cardinal) on Nov 01, 2024 at 01:29 UTC
    Or even
    my %slice_idx; @slice_idx{6, 13, 42, 66, 69} = ();

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]