I was trying to think outside the box and in the spirit of TIMTOWTDI
#!/usr/bin/perl -w use strict; my @FirstArray = qw(one two three); my @SecondArray = qw(four seven one eight two nine three seventeen); unless (index ((join "" , sort map {"@FirstArray" =~ /\b($_)\b/;} @Sec +ondArray) , (join "" , sort @FirstArray)) eq -1) { print "Second array contains all the elements in first array\n"; + } else { print "Second array does not contain all the elements in the first + array\n"; }
This is probably easily broken, but I thought it was neat.
Cheers - L~R
In reply to Re: Array lookup
by Limbic~Region
in thread Array lookup
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |