my %hash; @hash{@l2} = @l2; my @newlist = @hash{@l1}; #### my @newlist = map defined($_)?$_:'null', @hash{@l1};