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

[MacPerl] Signed Integers getting returned... Heck



I should probably post this one to the perl group too, but macperl users
appear to be more resourceful and clever... 'Nuf hype.

I have a 50 meg datastructure keyed to an index built with unsigned
integers. My search recovers a match, looks at the index and gets an
unsigned integer which refers to an offset in the 50M db. Unpack the
integer, seek the offset in the db, display the record.

$offset=unpack("I*",$index);
seek(FILE,$offset,0);
read(FILE,$record,$length);
print $record;

rather than returning an unsigned integer, I get the signed value back.
Kack! Especially troublesome when I seek the offset.

Works great with Macperl(development environment), Solaris(production
machine) <http://www.infohiway.com/isn/m3.cgi> NT(testing) and a linux box.

Just ported to a different linux(redhat)/apache running perl 5.03 and the
darn thing only returns signed integers. I know this isn't a macperl issue,
but I'm hoping somebody out-there has seen and solved. Or has practical
advice. Or can politely point where I'm being stupid.

Thanks in advance
JMK

John-Michael Keyes - jk@infohiway.com
http://www.infohiway.com