in reply to resetting Perl RegEx backreferences

Alternatively you can assign to your variable directly in list context:

($rs[2]) = $dorient =~ /^([^_]+)_/;

$rs[2] will be undefined, when the match wasn't successful.