in reply to How to substitute 0 (zero) Instead of 'n/a'
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+)/; } }
|
|---|