hello, Could you tell me how that get to work? I tries make module from a book, but fails. it says
Undefined subroutine &Book::Factorial::factorial_iterative_c called at + fact.pl line 3.
factorial.h============================ double factorial_recursive_c(int x); double factorial_iterative_c(int +x); factorial.c============================ double factorial_recursive_c(int x) { if (x < 2) return 1; return x * factorial_recursive_c(x - 1); } double factorial_iterative_c(int x) { int i; double result = 1; for (i = 2; i <= x; i++) result *= i; return result; } ============================== $h2xs -n Book::Factorial -A -O -x -F factorial.h add 'OBJECT' => 'Factorial.o factorial.o', to Makefile.PL $perl Makefile.PL $make $make test $make install
everything installed well symbols in factorial.c existent...
23: 00000af0 45 FUNC GLOBAL DEFAULT 12 factorial_iterative +_c 26: 00000aa0 76 FUNC GLOBAL DEFAULT 12 factorial_recursive +_c testing script============================= use strict; use Book::Factorial; my $result = Book::Factorial::factorial_iterative_c(5); print $result;

In reply to own perl module based on c library by gants

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.