Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi all, I've got some code that I'm trying to make usable with as many user setups as possible, and I've run into an odd problem. The first code block below does what it ought (uppercase $_) in 5.005_04, 5.6.0, 5.8.4, 5.8.5 and 5.8.10, but in 5.6.1 and 5.6.2 it turns 'Hello World' into
H
W
The second, largely identical, code block works fine in 5.6.[12], but that doesn't really explain why things have gone awry.
tr/a-z\x{fff03}-\x{fff05}\x{e0}-\x{f6}\x{f8}-\x{fe}\x{ff}\x{103}\x{105 +}\x{107}\x{109}\x{10b}\x{10d}\x{10f}\x{103}\x{105}\x{117}\x{119}\x{11 +b}\x{11d}\x{11f}\x{103}\x{105}\x{127}\x{129}\x{12b}\x{12d}\x{12f}\x{1 +33}\x{135}\x{137}\x{13a}\x{13c}\x{13e}\x{140}\x{142}\x{144}\x{146}\x{ +148}\x{14b}\x{14d}\x{14f}\x{151}\x{153}\x{155}\x{157}\x{159}\x{15b}\x +{15d}\x{15f}\x{161}\x{163}\x{165}\x{167}\x{169}\x{16b}\x{16d}\x{16f}\ +x{171}\x{173}\x{175}\x{177}\x{17a}\x{17c}\x{17e}/A-Z\x{fff00}-\x{fff0 +2}\x{c0}-\x{d6}\x{d8}-\x{de}\x{178}\x{102}\x{104}\x{106}\x{108}\x{10a +}\x{10c}\x{10e}\x{102}\x{104}\x{116}\x{118}\x{11a}\x{11c}\x{11e}\x{10 +2}\x{104}\x{126}\x{128}\x{12a}\x{12c}\x{12e}\x{132}\x{134}\x{136}\x{1 +39}\x{13b}\x{13d}\x{13f}\x{141}\x{143}\x{145}\x{147}\x{14a}\x{14c}\x{ +14e}\x{150}\x{152}\x{154}\x{156}\x{158}\x{15a}\x{15c}\x{15e}\x{160}\x +{162}\x{164}\x{166}\x{168}\x{16a}\x{16c}\x{16e}\x{170}\x{172}\x{174}\ +x{176}\x{179}\x{17b}\x{17d}/;
tr/a-z/A-Z/;tr/\x{fff03}-\x{fff05}\x{e0}-\x{f6}\x{f8}-\x{fe}\x{ff}\x{1 +03}\x{105}\x{107}\x{109}\x{10b}\x{10d}\x{10f}\x{103}\x{105}\x{117}\x{ +119}\x{11b}\x{11d}\x{11f}\x{103}\x{105}\x{127}\x{129}\x{12b}\x{12d}\x +{12f}\x{133}\x{135}\x{137}\x{13a}\x{13c}\x{13e}\x{140}\x{142}\x{144}\ +x{146}\x{148}\x{14b}\x{14d}\x{14f}\x{151}\x{153}\x{155}\x{157}\x{159} +\x{15b}\x{15d}\x{15f}\x{161}\x{163}\x{165}\x{167}\x{169}\x{16b}\x{16d +}\x{16f}\x{171}\x{173}\x{175}\x{177}\x{17a}\x{17c}\x{17e}/\x{fff00}-\ +x{fff02}\x{c0}-\x{d6}\x{d8}-\x{de}\x{178}\x{102}\x{104}\x{106}\x{108} +\x{10a}\x{10c}\x{10e}\x{102}\x{104}\x{116}\x{118}\x{11a}\x{11c}\x{11e +}\x{102}\x{104}\x{126}\x{128}\x{12a}\x{12c}\x{12e}\x{132}\x{134}\x{13 +6}\x{139}\x{13b}\x{13d}\x{13f}\x{141}\x{143}\x{145}\x{147}\x{14a}\x{1 +4c}\x{14e}\x{150}\x{152}\x{154}\x{156}\x{158}\x{15a}\x{15c}\x{15e}\x{ +160}\x{162}\x{164}\x{166}\x{168}\x{16a}\x{16c}\x{16e}\x{170}\x{172}\x +{174}\x{176}\x{179}\x{17b}\x{17d}/;
The problem actually seems to persist with any subset of the hex translations in parallel with the ASCII e.g;
tr/a-z\x{fff03}-\x{fff05}/A-Z\x{fff00}-\x{fff02}/;

--
In Bob We Trust, All Others Bring Data.


In reply to tr funkiness in 5.6.[12] (but not 5.6.0!) by belg4mit

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 taking refuge in the Monastery: (4)
As of 2024-04-22 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found