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

Re: Huffman encoder

by japhy (Canon)
on Feb 20, 2001 at 22:29 UTC ( [id://59729]=note: print w/replies, xml ) Need Help??


in reply to Huffman encoder

You can chop characters out like mad if you embrace the map EXPR, LIST syntax, instead of map BLOCK LIST. See, then:
map{$0{$_}++}split//,$_=<>; @0=map{[$_,$0{$_},$_]}keys%0;
become two PRECIOUS characters shorter:
map$0{$_}++,split//,$_=<>; @0=map[$_,$0{$_},$_],keys%0;


japhy -- Perl and Regex Hacker

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-09-17 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (22 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.