You could make two different subroutines, but you'd still have to know which one to call. You could make one subroutine handle both hex and dec - but then you would either have to give the sub an extra argument indicating whether the 'first number' is hex or dec OR you would have to make a sub that just 'does the right thing'. This would be just about impossible since, for instance "10" is a valid Hex number as well as a valid dec number. You COULD make a sub that assumed dec unless there was an a,b,c,d,e, or f in the value. Then you could assume it was hex.
--jim