Hi All,

How to PACK the "C/A*" data type by using Convert::Binary:C module.

Because the datatype is Pointer.

Ex.

binmode(S);
@Data=("asd");
$binary=pack("C/A*",@Data);        # its working fine
print S $binary;

================================================
I need by below
================================================

use Convert::Binary:C;

$c = Convert::Binary::C->new;
binmode(S);

my $c = Convert::Binary::C->new->parse(<<ENDC);

typedef struct
{
    unsigned char type; /* length(*ver) */
    char *ver;
} R;

ENDC

$data = {type => 3,*ver => "asd",};    # it gives error
$binary = $c->pack('R', $data);
print S $binary;

Thanks
Shan


--
DISCLAIMER:

This message and any attachments are solely for the intended recipient
and may contain confidential or privileged information. If you are not
the intended recipient, any disclosure, copying, use, or distribution of
the information included in this message and any attachments is
prohibited. If you have received this communication in error, please
notify us by reply e-mail and immediately and permanently delete this
message and any attachments. Thank you.

Reply via email to