Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

If Tux is correct and this has been "fixed", then I think the documentation for open.pm should be corrected. I certainly don't see how the offered code qualifies for:

"Any two-argument open(), readpipe() (aka qx//) and similar operators found within the lexical scope of this pragma"

I haven't dived into the guts (well, I have dived into guts related to open.pm but not recently and not in relation to this specific case), but it appears that the only thing within the lexical scope of the pragma is the passing of a file handle to an XS module. That XS module reads from the handle and the reading from the handle triggers "magic" (as you put it) that causes a file to be opened.

The opening is not done by code within the lexical scope of the pragma. Perhaps the documentation should say that it impacts 'open' within the temporal scope of the pragma? I doubt it actually does that, though (that wouldn't match my memory of the guts the last time I dived into them).

But if it isn't temporal scope, then I'm hard pressed to explain how it could actually work in this case. Perhaps somebody will explain it. I don't plan to spend time investigating this particular mystery.

I doubt the original poster's expressed desire for ignorance will lead to success when dealing with UTF-8 streams. Unfortunately, UTF-8 was defined in a way and supported by Unix (and Perl) in ways that make handling it correctly very often require significant diving into a lot of details.

- tye        


In reply to Re^3: Why Doesn't Text::CSV_XS Print Valid UTF-8 Text When Used With the open Pragma? ("lexical") by tye
in thread Why Doesn't Text::CSV_XS Print Valid UTF-8 Text When Used With the open Pragma? by Jim

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 wandering the Monastery: (2)
As of 2024-03-19 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found