in reply to Interpolation inside regex

Another way would be to avoid the substitution altogether and use split, ucfirst and join with maps.

print map { qq{@{ [ join q{ }, map { ucfirst } @$_ ] }\n} } map { [ split m{_} ] } @names;

I hope this is of use.

Cheers,

JohnGG