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

Re^7: Understanding pack and unpack changes for binary data between 5.8 and 5.10

by squentin (Sexton)
on Mar 13, 2009 at 21:26 UTC ( #750525=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $p=pack "V/a*", $s;
    my $l=length $p;
    
  2. or download this
    use Encode qw/encode/;
    my $p=pack "V/a*", encode('utf8',$s);
    my $l=bytes::length $p;
    # using bytes::length just to be sure, $p shouldn't have its utf8 flag
    + on, but in case it does...
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2018-09-18 13:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (156 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!