in reply to Trying to get fancy...
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Trying to get fancy...
by Purdy (Hermit) on Nov 28, 2001 at 20:36 UTC | |
by AidanLee (Chaplain) on Nov 28, 2001 at 20:45 UTC | |
by Purdy (Hermit) on Nov 28, 2001 at 20:48 UTC | |
by buzzcutbuddha (Chaplain) on Nov 29, 2001 at 18:45 UTC |