$time=$16; # Time Sample - 1000,000.00 @_1 = split "\,", $16; # Split the value in $16 (should be $time!) where commas occur, put the results in @_1. (eg 1000 and 000.00) if($#_1 eq 0){ # if there is one value in @_1 (ie no commas in $time) $time = int ($time); # set $time to the integer value of $time } if($#_1 eq 1){ # if there are 2 values in @_1 (at least one comma) $time=$_1[0]; # set $time to the first value (1000 in my example) $time=~ s/\,//g; # replace all the commas in $time with nothing $time*=1000; # multiply $time by 1000 } if($#_1 eq 2){ $time=1000;} # If there are 3 values in @_1 , set $time to 1000 if($#_1 eq 3){$time=1000;} # If there are 4 values in @_1 , set $time to 1000