Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: length() miscounting UTF8 characters?

by dave_the_m (Monsignor)
on Apr 27, 2014 at 22:32 UTC ( [id://1084054]=note: print w/replies, xml ) Need Help??


in reply to length() miscounting UTF8 characters?

The open pragma is documented to affect open() and similar ops within its lexical scope, but you aren't using open; you're using <> to read the already-opened magic ARGV filehandle.

Dave.

Replies are listed 'Best First'.
Re^2: length() miscounting UTF8 characters?
by choroba (Cardinal) on Apr 27, 2014 at 22:40 UTC
    My tests show that ARGV is affected if you call the script with a file name parameter, but it's not affected if you use it to read data from the standard input.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^2: length() miscounting UTF8 characters?
by AppleFritter (Vicar) on Apr 28, 2014 at 09:31 UTC

    Thank you for your reply, and good to know! This already came up a little further up; it turns out that there is a way to make the open pragma apply there as well, if you know the right magic incantation. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 01:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found