for my $key (keys %Hash) { my $value = $Hash{$key}; if(@$value !=~ /^\/\*/) #if the value is a comment donot print it. { if (scalar @$value) { # check that the arrayref isn't empty print "\n ", join(", ", @$value), "\n\n"; } } }