because it assumes that I want 'first' to be an array of all the matched groups, and so it dies with
"undefined method `upcase' for ["bar"]:Array (NameError)".
Is there any way to persuade Ruby to treat |first| as a (singleton) list of strings to be assigned? I can use |first,dummy| as a workaround, but is there a neater way that I'm missing?
because it assumes that I want 'first' to be an array of all the matched
groups, and so it dies with
"undefined method `upcase' for ["bar"]:Array (NameError)".
Is there any way to persuade Ruby to treat |first| as a (singleton) list
of strings to be assigned? I can use |first,dummy| as a workaround, but
is there a neater way that I'm missing?
Note: putting a "\n" at the end of a string that is printed with puts does
not have any effect, you'll have to put two "\n" if you want to have an
additional line.