Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thank you for the Traverse sub.

Frustratingly this sub(), when traversing my file tree, works fine, while my own humongous program doesn't and chokes on any filename that contains "non-ascii" characters, and I cannot as yet find what I am doing different.

Except that I am doing quite a bit of concatenation of strings and storage in intermediate variables, and I suppose that somewhere perl's smart handling of automatic internal string conversion to utf8-when-needed is biting me.

My real program scans several file trees, remembers in each the oldest file (storing the path in a table), then sorts the table on some formula, and passes the "best" path to another portion of the program for processing. It is in that other part of the program, when trying to use the path to open the file, that the problem occurs.
What I imagine is that somewhere along the line, what was initially read as a "bytes" entry, becomes an internal "utf8" string, and then open() or stat() do not recognise that filename anymore. Does that make sense ?


In reply to Re^2: directories and charsets by soliplaya
in thread directories and charsets by soliplaya

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 admiring the Monastery: (5)
As of 2024-04-16 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found