Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How do I stop printing a hash value

by PeterPeiGuo (Hermit)
on Dec 18, 2010 at 01:45 UTC ( [id://877722] : note . print w/replies, xml ) Need Help??


in reply to How do I stop printing a hash value

First of all, you need to change !=~ to !~, your code as it is won't even compile. Secondly, you don't want to apply matching against the array, it is not going to do what you wanted.

Peter (Guo) Pei

  • Comment on Re: How do I stop printing a hash value

Replies are listed 'Best First'.
Re^2: How do I stop printing a hash value
by iphone (Beadle) on Dec 18, 2010 at 01:58 UTC
    I am using the below
    if ((scalar @$value) && not grep (/\/\*(.*)\*\//,@$value)) { }

      Read the document for "grep" more carefully. The following might be a starting point for you, and you can continue from here:

      print join(",", grep(!/\/\*(.*)\*\//, @$value));

      Peter (Guo) Pei

        Thanks for all your help.The following works for me.

        if (scalar @$value) { # check that the arrayref isn't empty my @arr = grep(!/^\/\*/, @$value); print "\n ", join(", ", @arr), "\n\n"; }