Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Reading and unpacking on one line

by choroba (Cardinal)
on Nov 05, 2020 at 22:33 UTC ( [id://11123441]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Reading and unpacking on one line
in thread Reading and unpacking on one line

The behaviour depends on the filehandle. It's documented at the end of read

> depending on the status of the filehandle, either (8-bit) bytes or characters are read.

Similarly, sysread:

> Note that if the filehandle has been marked as ":utf8", Unicode characters are read instead of bytes

So, to read UTF-8, open the file handle with the :encoding(UTF-8) layer.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-26 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found