perlquestion
loris
<p>Dear All,</p>
<p>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:</p>
<code>
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";
</code>
<p>but this does not give me what I want (rat).</p>
<p>Can anyone enlighten me?</p>
<p>Thanks,</p>
<p>[loris]</p>