#!/usr/local/bin/perl -w
use strict;
my $number = '00120034';
# split at the position that has 4 digits
# behind and 4 digits ahead
my ($n1, $n2) = split /(?<=\d{4})(?=\d{4})/, $number;
print "$n1, $n2\n";
# strip leading 0's
($n1, $n2) = map { int $_ } ($n1, $n2);
print "$n1, $n2\n";
####
0012, 0034
12, 34
####
{
local $_ = $amount;
/\./ ? s/(?<=\d)(?=(\d{3})+(?:\.))/,/g : s/(?<=\d)(?=(\d{3})+(?!\d))/,/g;
$amount = $_;
}