:) but what is it supposed to do? I add
print join ' ', 1, PerlIO::get_layers($fh), "\n";
binmode($fh, ':raw:perlio') or warn "UHOH $! \n$^E \n$@\n ";
print join ' ', 2, PerlIO::get_layers($fh), "\n";
binmode($fh, ':raw') or warn "UHOH $! \n$^E \n$@\n ";
print join ' ', 3, PerlIO::get_layers($fh), "\n";
binmode($fh, ':raw:raw:raw:raw') or warn "UHOH $! \n$^E \n$@\n ";
print join ' ', 4, PerlIO::get_layers($fh), "\n";
binmode($fh, ':raw:raw:raw:raw:unix:crlf') or warn "UHOH $! \n$^E \n$@
+\n ";
print join ' ', 5, PerlIO::get_layers($fh), "\n";
for(1..3){
binmode($fh, ':raw:pop') or warn "UHOH $! \n$^E \n$@\n ";
print join ' ', 6, PerlIO::get_layers($fh), "\n";
}
#~ binmode($fh, ':raw:crlf:perlio') or warn "UHOH $! \n$^E \n$@\n ";
binmode($fh, ':pop:pop:win32') or warn "UHOH $! \n$^E \n$@\n ";
print join ' ', 6, PerlIO::get_layers($fh), "\n";
and I get
1 unix crlf
2 unix crlf perlio
3 unix crlf perlio
4 unix crlf perlio
5 unix crlf perlio unix crlf
6 unix crlf perlio unix
6 unix crlf perlio
6 unix crlf
6 win32
in addition to the file-already-open
if turning off unix and turning it on again, or turning it on twice, is wrong, perl should warn or die
PerlIO seems thin, OTOH, the test suite lists a TODO #56644: PerlIO resource leaks on open() and then :pop in :unix and :stdio but its closed
Any way you look at it there is nonsense around :)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.