Dear All,
I have an array of available things, an array of requested things and want to find which requested things are not available. I would like to do something like:
my @available_things = qw/ant bat cat dog /; my @requested_things = qw/bat rat/; my @not_available_requested_things = map {grep(!/$_/,@available_things)} @requested_things; print "available: @available_things\n"; print "requested: @requested_things\n"; print "requested, not available: @not_available_requested_things\n";
but this does not give me what I want (rat).
Can anyone enlighten me?
Thanks,
In reply to Matching array elements not in another array by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |