
Bug: unpack in scalar context
According to the Camel book, unpack in a scalar context unpacks a
single value. In fact, it returns the format string if the format
string starts with an x specifier.
% perl -v
This is perl, version 4.0
$RCSfile: perl.c,v $$Revision: 4.0.1.4 $$Date: 91/06/10 01:23:07 $
Patch level: 10
Copyright (c) 1989, 1990, 1991, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 4.0 source kit.
% perl -e '$_="012345XY98765"; $m = unpack("x6 a2", $_); print $m;'
x6 a2
% perl -e '$_="012345XY98765"; ($m) = unpack("x6 a2", $_); print $m;'
XY
% perl -e '$_="012345XY98765"; $m = unpack("a2", $_); print $m;'
01
hmmmmmm.....
--
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb