Wow. That takes my vote for most obfuscated-but-didn't-mean-to code of the day.
First, a rewrite of the code, so we can start to see what's going on:
The {} say that you need to do some stuff on each element of @listB. However, your code is of the form grep ( @listB ); Are you sure this is what you want?$listA[0] = [qw(1 foo bar)]; $listB[0] = [qw(1 bar baz)]; print "First record from \@listA: $listA[0][0]\n"; @listToExpire = grep { } @listB;
Update: Try the following:
Interestingly enough, you can substitute map for the grep. Of course, I wrote it initially with map, cause that's how I think. TMTOWTDI.my @listToExpire = grep { my $a = $_; (grep /$a/, @listA) ? () : ($a); + } @listB;
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In reply to Re: Trying to get fancy...
by dragonchild
in thread Trying to get fancy...
by Purdy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |