in reply to Re: REGEXP: only need last matching string
in thread REGEXP: only need last matching string

Then
() = $str =~ /abc\s(\d+)/gs;
will suffice, i.e. no need for the $dum variable.