in reply to Invalid Type -- Unpack

unpack works better when the format template string comes first, and the data being unpacked comes as the second argument. In fact, it doesn't work at all the other way around. ;)

eg...

my(@stuff) = unpack "A9", $packed;

not...

my(@stuff) = unpack $packed, "A9"; # Wrong!

Dave

Replies are listed 'Best First'.
Re: Invalid Type -- Unpack
by SamCG (Hermit) on Sep 01, 2004 at 19:03 UTC
    Ah, just one more reminder to keep me humble <laughing at myself> Thanks, Dave!