As the original post stated, this is intended for Perl 5.8.0 or later.
Under Perl 5.8.0, it won't create a physical file, but instead, a proper in-memory file. That is why I recommended 5.8.0 or later. ...well, that and the fact that I assumed that passing a scalar ref as a filename to a pre-5.8.0 Perl wouldn't even run.
Out of curiosity, in your test on Perl 5.6.1, did it create a file named "SCALAR(0x1234567)" (or something like that) on your file system?
Update:
I have now modified the original JAPH by adding "require 5.8.0" to the beginning of the script so that people who fail to read the caviat won't inadvertantly run it on pre-5.8.0 versions. You can still remove that 'require 5.8.0' part to test it on pre 5.8.0 versions if you want. It won't hurt anything. But it probably will create a zero-byte file named "SCALAR(0x.....)" that you'll have to erase later. Again, no biggie.
Dave
"If I had my life to live over again, I'd be a plumber." -- Albert Einstein
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.