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

Re: What are pack/unpack used for?

by Tux (Abbot)
on Jun 11, 2012 at 10:50 UTC ( #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 Unpacked: 100800288 Packed: 28800128

Enjoy, Have FUN! H.Merijn

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://975537]
[LanX]: ah... Denmark is planning to build a wall at the German border!
[LanX]: # Pestis Africana Suum
[erix]: that's an old plan, I think. Isn't there already a danewal (or some such name)?
[marto]: Build with -Wall

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2018-03-22 18:36 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (283 votes). Check out past polls.