[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Fun with pack()



On 26/12/2000 13:19:10 Ilmari Karonen wrote:

>perl -le'print map{substr"  ETINAMSDRGUKWOHBLZFCP VX Q YJ",vec(pack("b*"
>         ,$_.1),0,8),1}split/ /,".--- ..- ... -  .- -. --- - .... . .-."
>         ."  .--. . .-. .-..  .... .- -.-. -.- . .-."'
>

This is coooooool.
Empirical tests suggest that ord($x) could be used instead of vec($x,0,8) in
this case.

perl -le'print map{substr"  ETINAMSDRGUKWOHBLZFCP VX Q YJ",ord(pack("b*"
         ,$_.1)),1}split .....

Csaba



--
Csaba Ráduly, Programmer - OS/2                      Sophos Anti-Virus
email: csaba.raduly@sophos.com                   http://www.sophos.com
US support: +1 888 SOPHOS 9                UK Support: +44 1235 559933



==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe