I voted this one down because
- it's an unnecessary use of runtime-string-compilation eval
- it breaks on general data, so it's not a good general pattern, and you didn't
add that disclaimer to your text. Hint: what if your data contained single quotes?
Others have posted faster and more general solutions, so I won't include one
of mine here. But avoid this
eval solution, please.
-- Randal L. Schwartz, Perl hacker