HP3000-L Archives

October 2003, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Dave Oksner <[log in to unmask]>
Date:
Thu, 9 Oct 2003 10:42:40 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
On Thu, Oct 09, 2003 at 05:54:28PM +0100, Braun Brelin wrote:
> I tried doing a pack("H8",$key) where $key = <some valid key> and then passing
> that to the DbFind() function, but I'm getting back the following error:

Once thing to watch out for when using the pack() function is the count.
In _Programming Perl_ they warn you that when you use the hexadecimal pack,
you need to count the number of nibbles, not bytes.

Also, what, exactly could be in $key?  You claim "<some valid key>" but is
it in a form that pack is going to expect?

You might also try breaking it up into something like

pack("A2","01") . pack("H12",$key)

You could always replace the "01" with a variable if it changes, but since
it is a character and not packed, you probably should treat it differently,
just for ease of use.

Dave

--
+----David Oksner-----http://www.case.net/----+
|Gibb's Law:                                  |
|  Infinity is one lawyer waiting for another.|
[log in to unmask]

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2