for (@ids) { my ($id,$extra)=@$_; print exists $hash{$id} ? "$id => $hash{$id} => $extra\n" : "$id\t$extra\n"; }