in reply to My 'perldar' tells me there is a 'better' solution for this list operation
Update: Ah, after two downvotes, I see that the OP wants the string 'null' rather than actual null values. Well, that certainly is worth throwing dung at someone over. Sheesh. One change to the final line:my %hash; @hash{@l2} = @l2; my @newlist = @hash{@l1};
my @newlist = map defined($_)?$_:'null', @hash{@l1};
|
|---|