http://www.perlmonks.org?node_id=239052


in reply to Re: strings with options - how do I do this?
in thread strings with options - how do I do this?

Works fine with the caveat that the string shouldn't contain any meta characters that glob might want to expand, like '*'. And this:
for ($text) { s/\[/{/g; s/\]/}/g; s/\|/,/g; }
could be written as: $text =~ tr/[|]/{,}/;

-- Hofmator