Two remarks:
(But use sum0 if @array can be empty and undef won't do.)Use List::Util qw( sum ); $count = sum map s/$foo/$bar/g, @array;
In reply to Re: How to count substitutions on an array
by Anonymous Monk
in thread How to count substitutions on an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |