Forgetting how to use vec

Discussion in 'Perl' started by Aaron Sherman, Feb 5, 2004.

  1. I have a small piece of Perl code that does something like this:

    for($i=0;$i<length($x);$i++){
    vec($y,$i*7,8)=vec($x,$i*8,8);
    }

    But it doesn't pack 7-bit data from $x into $y the way I thought it
    would. Could someone enlighten me on how I'm mis-reading this? What I
    really want is to pack the low 7 bits of $x into $y, with no
    high-bit-padding.
     
    Aaron Sherman, Feb 5, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Hobley

    vec - a misunderstanding

    Mark Hobley, Mar 18, 2006, in forum: Perl
    Replies:
    1
    Views:
    2,638
    John Bokma
    Mar 18, 2006
  2. Snoeys Andy
    Replies:
    2
    Views:
    429
    White Wolf
    Sep 12, 2003
  3. er
    Replies:
    6
    Views:
    529
    Andre Kostur
    Sep 14, 2007
  4. Ioannis Vranos

    (&vec)== &vec[0]?

    Ioannis Vranos, Sep 30, 2008, in forum: C++
    Replies:
    5
    Views:
    449
    Juha Nieminen
    Oct 1, 2008
  5. Aaron Sherman

    Forgetting how to use vec

    Aaron Sherman, Feb 6, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    208
    Aaron Sherman
    Feb 13, 2004
Loading...

Share This Page