http://www.perlmonks.org?node_id=877715

iphone has asked for the wisdom of the Perl Monks concerning the following question:

I have a hash like below,values are in an array,some values of array are comments,now I want to add a check not to print the comments.I treid the below but not successful $VAR1 = { 'file.txt' => [ 'pages/value/data.h ', '@label ', '/* CAT/APP/file.c */ ', };

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"; } } }