Open-scalar-as-file is only in fairly recent Perls though (5.8 perhaps?). So if your code has to be portable (such as a CPAN submission), don't do that... yet.
| [reply] |
Definitely 5.8. You can do something similar with IO::Scalar with 5.6 - I've got code that checks the perl version, and if 5.8, uses the \$scalar trick, but if 5.6, uses IO::String. Which, of course, doesn't actually come with 5.6, but if you are making a CPAN submission, you can easily put a pre-req on IO::String. Maybe not quite as easy to do if you only want the pre-req for 5.6, but still possible.
| [reply] |