"Corey M. Ellis" wrote: > > Hi everyone, Hello,
> I have a question about using pack/unpack. I am packing a structure > using the following code (It will be at the end of the mail). I am > basically packing the following template: "A2A50la*" > > within the a* is all the data that I read from $file1, after reading > this data I want to pack a 2 byte trailer. I can pack it with no problem, > but when I try to unpack the data I tried unpacking using to unpack > statements and it failed. I want to do something like this. > > ($header, $path, $length, $rest) = unpack "A2A50la*", $packedStuff; > ($data,$trailer) = unpack "a$lengthA2", $rest; You probably want to use the '/' template character. ($header, $path, $data, $trailer) = unpack 'A2 A50 l/a A2', $packedStuff; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]