Well, there are a bazillion ways to do this.
$impressions += $value unless $value =~ m{n/a};
is one obvious way.
I'd be more inclined toward
while (<FH>) { if (/Impressions:/) { print; $impressions += $1 if /(\d+)/; } }
In reply to Re: How to substitute 0 (zero) Instead of 'n/a'
by Zed_Lopez
in thread How to substitute 0 (zero) Instead of 'n/a'
by danield
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |