s/(\d*)(\d\d)/$1.$2/ or $price = substring(..).'.'.substr(..) (I asume that s/../../ is exactly doing this)