Thank u for your quick reply.
How to install following module.or How to install following module in
my
system.I'm working in WINDOWS NT.
Convert::Binary::C;Thanks and Regards,Shan
BTW, it's perl or Perl, but never PERL.
I am guessing your new to this list because your making a few common fau
pau's.
Send you emails to the list so that others can offer advice and learn
from your experience. Can you put your message at the bottom of the
last-reply. And try and cut out the disclaimers if you can.
Back to your question:
I'm using ActiveState.May I use CPAN module for that.If so how it would
be.
In that case you should have a program called PPM in the program group
or if you open up a command prompt and type ppm you should get a new,
cpan shell.
cpan>
If you don't there is something wrong. If you type help it will give
you some advice on the commands. To install Convert you would type
`install Convert::Binary::C`
You should be aware that not all modules from cpan are available to
activestate and I didn't see Convert::Binary::C in the list at
http://aspn.activestate.com/ASPN/Modules?module_name=C&order=name&query_start=211.
That's one of the reason some users prefer Strawberry Perl, it has
better support[1] for cpan modules.
Hi Dermot,
Thank you for ur help.Now I have installed Convert::Binary::C.
But my ppm is installed this as 0.68 version.But I need 0.74.
I don't know where it(0.68) takes.But CPAN archives have 0.74 version
Try to remember to hit reply-to-all when you reply Shan.
Unfortunately the versions of lots of modules on ActiveState lag
behind CPAN. That's one of the reasons some users prefer Strawberry
Perl. Refer to Rob's email (Sisyphus) on how to install a module from
CPAN.
Good luck,
Dp.
--
Thank you very much for the input and guidance.
Finally I got installed Convert::Binary::C to my system.
And I need another help, Please tell me
How to change code
$FileName= "a_struct";
open S,">$FileName\.bin" or die "Unable to open.\n";
binmode(S);
@Data=(13,0,90,12231,"vdd33");
# it is working fine for binary file conversion.
$ary=pack("S,C,C,I,C/A*",@Data);
print S $ary;
====================================
use Convert::Binary::C;
$FileName= "a_struct";
open S,">$FileName\.bin" or die "Unable to open.\n";
$c = Convert::Binary::C->new;
binmode(S);
my $c = Convert::Binary::C->new->parse(<<ENDC);
typedef struct
{
unsigned short len;
unsigned char typ;
unsigned char sub;
unsigned int tim;
unsigned char size; /* strlen(line) */
# It gives error when packing pointers
char *line;
} str;
ENDC
$data = {rec_len => 13, rec_typ => 0, rec_sub => 20, mod_tim =>
1223134526,size => 5, *line => "vdd33",};
$ary = $c->pack('str', $data);
print S $ary;
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.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/