If you judge whether a value is "present" by string equality (and it would seem you do), you could just use a hash:
my %map; @map{@l2} = (); my @list = map { exists $map{$_} ? $_ : 'null' } @l1;
( Also: "perldar"++ )
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re: My 'perldar' tells me there is a 'better' solution for this list operation
by Sidhekin
in thread My 'perldar' tells me there is a 'better' solution for this list operation
by OfficeLinebacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |