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

Re: [MacPerl] Pack/UnPack Question



>My question is this:  Does UNPACK do something to the
>information it is unpacking?

[snip]

I'm not sure quite where your problem lies, but I doubt it is unpack()
behaving oddly. Try running the following which packs ten groups of three
signed integers, and then unpacks the whole lot three times.

#!perl

for(0..9) {
    push (@list, pack("iii", 130+$_, 140+$_, 150+$_))
}

for(1..3) {
    foreach (@list) {
        foreach $n (unpack("iii", $_)) {print $n, ", "}
        print "\n"
    }
    print "\n"
}

There seems to be no problem on this machine at least but I wonder how it
would go on yours?

Alan Fry