Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Simplest Possible Way To Disable Unicode

by ikegami (Patriarch)
on May 24, 2011 at 19:19 UTC ( [id://906557]=note: print w/replies, xml ) Need Help??


in reply to Re: Simplest Possible Way To Disable Unicode
in thread Simplest Possible Way To Disable Unicode

Still, I'm still curious if there is some way I can force Perl into a pre-Unicode state.

There's no way to disable support for wide strings. The closest is use bytes;, but it would have made your error harder to find.

There's no way to prevent chr(0x4096) from working short of overriding chr.

$ perl -E' use subs qw( chr ); sub chr(_) { my $ch = CORE::chr($_[0]); $ch lt "\xFF" or die; return $ch; } say chr for 65, 4096; ' A Died at -e line 5.

My guess is that in the past, attempting to give chr() an argument greater than 255 would have resulted in an fatal error (or at least warning) that would have tipped me off to the problem.

It did result in a fatal error, and despite being further down the line, the error message was spot on.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://906557]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found