$rrow_test =~ s/$rex[0]/$rex[1]/ig; #### "Replace the first occurrence of $rex[0] with $rex[1]."