shasundaram007 has asked for the wisdom of the Perl Monks concerning the following question:
================================================ I need by below ================================================binmode(S); @Data=("asd"); $binary=pack("C/A*",@Data); # its working fine print S $binary;
Thanks Shanuse 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;
|
|---|