my $thing = '12340019'; $thing = s/(\d{4})(\d{4})/$1 $2/; my @splat = split(/ /, $thing);