Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: What are pack/unpack used for?

by Tux (Canon)
on Jun 11, 2012 at 10:50 UTC ( [id://975537]=note: print w/replies, xml ) Need Help??


in reply to What are pack/unpack used for?

unrelated to the Unix pack command, it can have the same effect, which matters if resources lack:

use Devel::Size qw(total_size); my @aoa = map { [ int rand 1_000_000, int rand 20_000, chr 32 + int ra +nd 40 ] } 0 .. 450_000; my @aop = map { pack "l>s>A", @$_ } @aoa; say "Unpacked: ", total_size (\@aoa); say "Packed: ", total_size (\@aop); => $ perl test.pl Unpacked: 100800288 Packed: 28800128

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

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

    No recent polls found