<?xml version="1.0" encoding="windows-1252"?>
<node id="1007926" title="Remove letters from variables used in math operation?" created="2012-12-08 16:09:11" updated="2012-12-08 16:09:11">
<type id="115">
perlquestion</type>
<author id="910948">
shadowfox</author>
<data>
<field name="doctext">
I have variables used in math operations that have some extra non-digit data, usually just a letter following them. The math works fine, but naturally I get warnings about the argument not being numeric.

&lt;code&gt;use warnings;
while ($line = &lt;DATA&gt;){
		chop($line);
		($a,$b,$c,$d,$e,$f,$g)=split(",",$line);
		$sum = ($a+$b+$c+$d+$e+$f+$g);
		print $sum;
}
		
__END__
86f,934e,92,102i,14,19,222,&lt;/code&gt;

The value at the end, 1469 is accurate but I'd like to take out the letters and avoid the warnings as they are not needed in my data context.

&lt;code&gt;Argument "934e" isn't numeric in addition (+) at test.pl line 7, &lt;DATA&gt; line 1.
Argument "86f" isn't numeric in addition (+) at test.pl line 7, &lt;DATA&gt; line 1.
Argument "102i" isn't numeric in addition (+) at test.pl line 7, &lt;DATA&gt; line 1.
1469&lt;/code&gt;

I tried using (s/\D//g) in various ways but I'm just getting it wrong, can this be easily done without altering each variable before the math operation individually? Please don't lecture me on strictures, this is a small example of my problem, not polished code.</field>
</data>
</node>
