in reply to Re: keeping binary data raw
in thread keeping binary data raw

this seems to create a result much closer to what i would expect (where the compressed length is < the input length). however, i can't claim i understand the whole newSVpv() thing. I dont need the vbyte_len returned, this is simply an internal value i used for printing out a representation of the compressed numbers. however, when i just try to do a newSVpv with one value, it doesnt compile.

Replies are listed 'Best First'.
Re^3: keeping binary data raw
by ikegami (Patriarch) on Oct 26, 2007 at 16:49 UTC

    vbyte_result points to an array of characters. You can't do anything with an array unless you know its size. How is Perl suppose to know how big the array is? For the same reason you need to know the length of the array to print it, you need to know the length of the array to create the Perl string the contains it. That's why you need to pass both the data and the length of the data to newSVpv.

      forgive me, i couldnt find how newSVpv worked. thanks!