$d = "123456789"; $d =~ s/(?<=\d)(?=(\d\d)+$)/-/g; print "$d"; #### $d =~ s/(?<=^(\d\d)+)(?=\d)/-/g; #### Variable length lookbehind not implemented in regex; marked by <-- HERE in m/(?<=^(\d\d)+)(?=\d) <-- HERE / at Noname1.pl line 4.
## $d =~ s/(?<=^(\d\d)+)(?=\d)/-/g; ##
## Variable length lookbehind not implemented in regex; marked by <-- HERE in m/(?<=^(\d\d)+)(?=\d) <-- HERE / at Noname1.pl line 4.