in reply to Checksum Help Again

If the code you show is the contents of the 'test.pl' file, then you get errors because it is not correct Perl syntax.

Replies are listed 'Best First'.
Re^2: Checksum Help Again
by TeamViterbi (Novice) on Jul 07, 2009 at 23:43 UTC
    hmm. i didnt realize that. Is this in C? how can i convert this into correct syntax?
        What do you mean cautious about making assumptions? Id rather just use perl unless its difficult to convert.

      Your "program" defines one subroutine. For it to be of any use, you will have to have or to write a program to call the subroutine. If that is in C then you should leave your subroutine definition in C. If it is Perl, then you might write a new subroutine in Perl.

      There will be no trivial way to convert the subroutine definition. First you might determine how the arguments will be passed. This will be different because basic Perl data types are different from basic C data types - Perl doesn't have pointers like C does and strings are somewhat different also. Then you can do the same for your return value. Finally, you can write the body of your subroutine. Your sample code is quite simple, so writing an equivalent in Perl should be easy. If it is not obvious, then you probably need to read an introduction to C or to Perl or both.