Perl Weekly Challenge 035

This week's challenge was to encode/decode binary morse code.

Sample Run

$ perl perl5/ PWC

$ perl perl5/ 1011101110100010111011100011101011101


  • Both parts use much of the same logic: split on gaps and map!
  • In both we start with the same hash but in Part 2 we use the reverse, in order to look up letters by their morse value.
  • I can't recall ever having used join so many times in any one script before. The usage here seems appropriate in that we are making a lot of use of arrays but then need to merge their elements into a single string.

Comments for this post were locked by the author