Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
:) 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 :)


In reply to Re^2: Win32: Setting a layer with binmode causes problem with close() on Windows (warnings) by Anonymous Monk
in thread Win32: Setting a layer with binmode causes problem with close() on Windows by rovf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found