my $names = &getNames;
my $valid_names = &validateNames(\$names);
usually, I noticed that &validateNames(\$names); could be &validateNames($names); just to make things easier.
However, you can use it, just more messy looking
sub validateNames{
my $valid_names=shift;
print Dumper($valid_names);
# I want to access ( print ) the data here
my $category = ();
foreach $category (sort keys %{${$valid_names}})
{
print "INFO - $category . Name : " . ${${$valid_names}}{$category
+}{'name'} . "\n";
print "INFO - $category . Email : " . ${${$valid_names}}{$catego
+ry}{'email'} . "\n";
}
}