in reply to What's vec?

vec EXPR, OFFSET, BITS The vec function provides a compact storage of lists of unsigned integers. These integers are packed as tightly as possible within an ordinary perl string. EXPR is treated as a bit string. OFFSET specifies the index of the particular element. BITS specifies how wide each element is in bits. Your JAPH does not run on my system, output: jtjt `jjt``j j`jj ```j`j cheers tachyon

Replies are listed 'Best First'.
Re: Re: What's vec?
by iamcal (Friar) on May 24, 2001 at 11:46 UTC
    The question was rhetorical :p

    Do you have a dbcs? All my JAPH does is reverse the two bit-words of each character.

    Or perhaps your $?, $^F or $| don't default as mine do.

    try this version with hard coded constants:

    #!/usr/bin/perl -w use strict; $_="011291020310415102805081036150812103801030115081"; s/(..)/\\x$1/g;eval"\$_=\"$_\";";print,if($_=join'',map{ chr((vec($_,0,4).vec($_,1,4))+96)}split//)=~s;~; ;g;