i had print as like print 'name :$name', ((exists $name_map->{$name} ) ? "is in hash" : "is not in hash"), "\n"; above the if condition but it prints not in hash .without taking hash how it can rename the contents