more useful options | |
PerlMonks |
complementary array indicesby coldy (Scribe) |
on May 11, 2009 at 00:43 UTC ( [id://763169]=perlquestion: print w/replies, xml ) | Need Help?? |
coldy has asked for the wisdom of the Perl Monks concerning the following question:
I have an array @a that gives some indices of another array @b eg , @a_indices = (1,3,5) If I know the size of @b, is there an easy way to determine the complementary positions? eg if $b = 10 what are the positions that are not @a. I was thinking I could create an array of indices and then find the non-intersecting elements with @a_indices. Surely there must be an easier way? Thanks.
Back to
Seekers of Perl Wisdom
|
|