in reply to Re^2: Net::OpenSSH quoting problems
in thread Net::OpenSSH quoting problems

This works for me:
DB<5> $object = "2-4 5-12" DB<6> $object =~ s/([-\d]+)/\\$1/g DB<7> p $object \2-4 \5-12
Or you could store the backslash in a variable and use that variable:
DB<11> $c = '\\'; DB<12> p $c \ DB<13> $object = "2-4 5-12" DB<14> $object =~ s/([-\d]+)/$c$1/g; DB<15> p $object \2-4 \5-12