in reply to Re^3: Translating ANSI C to Perl
in thread Translating ANSI C to Perl

Bart,

Now, almost everything is working :-) but I see a little difference between C code and Perl, do you help me to understand why ?

ANSI C:
$ sudo ./get_HW_KEY e000f030392f30322f303400fc00
Perl:
$ sudo perl seek.pl e000f030392f30322f303400fcc4
best regards

Replies are listed 'Best First'.
Re^5: Translating ANSI C to Perl
by TGI (Parson) on Dec 04, 2006 at 15:19 UTC
    The bug is in your C code. fgets() stops after reading 13 characters and puts a NULL character into position 14, in order to ensure that your string is always properly NULL terminated. Your perl code reads all 14 characters from the file.


    TGI says moo

      I really don't know about that ... thank's
      In my perl code, I'm just considerating just 12 first chars.