in reply to Re^2: print the values
in thread print the values

Change skip condition to the opposite, from

next if ! exists $names_hash{$names};

to

next if exists $names_hash{$names};