in reply to Re: Best way to put : between fields in a string
in thread Best way to put : between fields in a string

Using $;

my $s = 'A3xyz45M98AB7Z9'; my $i = 0; %_ = map { (++$i, $_) } split /(?<=\d)(?=\D)/, $s; local $; = ":"; $_{ (), map { delete $_{$_} } 1..$i }=0; print keys %_;

Couldn't help myself O:-) Sorry :-)