> The second quote was not escaped because in the regex $tok =~ /(\\+)$/ the $ will match the end of a string, but also match before a newline at the end of a string, so the code thinks that the quote is being escaped when it’s escaping the newline.
The only time you'd want to write assembly in production code would be if you need to hand roll some optimisation. So I don't really understand your point here,