Similar behavior when you try to auto-open a string ref via @ARGV
Well, I had never thought of that and never seen it documented, although it would certainly be useful a feature to have. But it is somewhat annoying that e.g. '<' works and '<:raw' doesn't. perldoc -f open, now that I notice, only says:
Since v5.8.0, perl has built using PerlIO by default. Unless you've changed this (i.e. Configure -Uuseperlio), you can open file handles to "in memory" files held in Perl scalars via: open($fh, '>', \$variable) || ..
There's another example later (and no other ones) again with '>', but the technique also works in read mode and, now that I check, with '+>' and '+<'. OTOH it is not entirely clear if the above text is to mean that "in memory" files should be provided only in write mode or whenever the third argument is a scalar reference...
In reply to Re^2: Clash between IO layers and "in memory" files?
by blazar
in thread Clash between IO layers and "in memory" files?
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |