note
Discipulus
Effectively i had no success in append mode (all tests on windows as above) as suggested by Anonymous.<BR><BR>
The possibility to open an handle to a string is in the [href://http://perldoc.perl.org/perlfaq5.html#How-can-I-open-a-filehandle-to-a-string%3f|Perl Faq] and also the possibility to dup a filehandle is in the [href://http://perldoc.perl.org/perlfaq5.html#How-do-I-dup()-a-filehandle-in-Perl%3f|Perl Faq]. Also, as you already said, is worth to read [doc://open] and search for the phrase "Perl scalars".<BR><BR>
The crucial point seems to be spotted by Anonymous here above: the <c>'>&'</c> or <c>'>&='</c> trick works only with descriptors and in your case ELISHEVA we have no descriptor:
<CODE>
# perl -e ' open $h,">", \$s or die; print qq(fileno: [).fileno ($h).qq(]\n);'
fileno: [-1]
</CODE>
And [doc://fileno] doc says it explicitly:
<blockquote><i>
Returns the file descriptor for a filehandle, or undefined if the filehandle is not open. If there is no real file descriptor at the OS level, as can happen with filehandles connected to memory objects via open with a reference for the third argument, -1 is returned.
</i></blockquote>
So it seems only an hedge case worth to be inserted in the [doc://open] documentation and in the [href://http://perldoc.perl.org/perlfaq5.html#How-can-I-open-a-filehandle-to-a-string%3f|relevant Faq]<BR><BR>
As side note i remember the [href://http://perldoc.perl.org/perlvar.html#Variables-related-to-filehandles|$^F] or maximum file descriptor. How an handle opened on a reference acts in respect of this? is close_on_exec set in the right way? or this will result in zombie handles?<BR>Might be worth to clarify also this in the docs.<BR><BR>L*<BR>
<div class="pmsig"><div class="pmsig-174111">
There are no rules, there are no thumbs..<BR>
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
</div></div>
1131938
1132083