in reply to Another puzzled RegEx Problem.
No external loop, no reverse and nothing but "-" in the substitution part:
$d =~ s/(?!^|$)(?(?{ pos() % 2 })(?!))/-/g; [download]
Update: Bug fix. I originally forgot to prevent "-" from being placed at the end.