use strict; use warnings; my $some_string = "0,-933"; my ($id1, $n1) = split(",",$some_string); my $dif = $id1 - $n1; print $dif;