On Thu, 13 Nov 2003 01:07:45 -0500, Michael Higgins wrote:

>map { $total += $_=~m#[\r\f]+#g } @data;

This won't do what I think you want it to do. m//g in scalar context
will match once or not a t all, but never mutliple times, even if it
could match more than once. I think dropping the /g wouldn't affect the
result, in this case.

This might produce better results ("$_ =~ " is superfluous):

        map { $total += () = m#[\r\f]+#g } @data;

Apart from the "+", which confuses me a little, you also could try out
the tr/// operator:

        map { $total += tr#\r\f##d } @data;

-- 
        Bart.

Reply via email to