$totcalls += $layer3 =~ /^([0-9]*)/ && $1;
or better yet
$totcalls += do { no warnings 'numeric'; 0+$layer3 };
Your s/// will never match because it's modifying $totcalls after the sum-assign (i.e when it contains a number).
In reply to Re: avoid warnings in Copying and Substituting Simultaneously
by ikegami
in thread avoid warnings in Copying and Substituting Simultaneously
by mvcorrea
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |