
iphone
User
Dec 17, 2010, 8:43 PM
Post #1 of 2
(1193 views)
|
|
How to stop printing a value
|
Can't Post
|
|
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 tried the below(print join(",", grep(!/\/*.*?\/*/, @$value)); 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 (scalar @$value) { # check that the arrayref isn't empty print join(",", grep(!/\/*.*?\/*/, @$value)); } }
|