##
my $resistance = ;
if ($current =~ /mA/) {
$current =~ s/mA//;
$current =~ s/(^\s+| )//;
$current /= 1000;
}
## ##
my $input = ;
my ($current) = $input =~ /^\s*[\d.]+\s+/ or do {
error_stuff();
... # next, redo, or return, as appropriate
};
$input =~ /\s+mA\s*$/ and $current /= 1000;