Hi, As I said, its just a wrapper over C functions, there's not much of code in it (works with Dynaloader and AutoLoader). It works fine if I use this module alone. Here is the code:
package ABC; $ABC::VERSION = '0.02'; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); require Exporter; require DynaLoader; require AutoLoader; @ISA = qw(Exporter AutoLoader DynaLoader); # Items to export into callers namespace by default. @EXPORT = qw( new_time_var dl_ascii_to_date dl_ascii_to_time dl_close_cache ); @EXPORT_OK = qw(); bootstrap ABC $VERSION;
and here is the wrapper module:
package PQR; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); require Exporter; require AutoLoader; use ABC; $PQR::VERSION = $ABC::VERSION; @ISA = qw(Exporter AutoLoader); @EXPORT = qw( new_time_var dl_ascii_to_date dl_ascii_to_time dl_close_cache ); @EXPORT_OK = qw(); sub new_time_var { return ABC::new_time_var(@_); } sub dl_ascii_to_date { return ABC::dl_ascii_to_date(@_); } sub dl_ascii_to_time { return ABC::dl_ascii_to_time(@_); } sub dl_close_cache { return ABC::dl_close_cache(@_); }
The actual subroutine signatures are:
<new_time_var>() <dl_ascii_to_date>(<string>) <dl_ascii_to_time>(<string>, <dtp>) <dl_close_cache>(<dcp>)
When I test this using a script I get the following errors:
>/u/agarwsun/test> perl -wc test.pl
Prototype mismatch: sub PQR::new_time_var () vs none at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 71.
Subroutine new_time_var redefined at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 67.
Prototype mismatch: sub PQR::dl_ascii_to_date ($) vs none at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 76. Subroutine dl_ascii_to_date redefined at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 74.
Prototype mismatch: sub PQR::dl_ascii_to_time ($$) vs none at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 81.
If I do not re-export the functions in PQR, and extend from ABC, I don't get the errors related to redefining subroutines, but I still get prototype mismatch errors:
Prototype mismatch: sub ABC::new_time_var () vs none at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 22.
Prototype mismatch: sub ABC::dl_ascii_to_date ($) vs none at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 27.
Prototype mismatch: sub Deshaw::DateLib::dl_ascii_to_time ($$) vs none at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/PQR.pm line 32.

In reply to Creating wrapper over a wrapper by sunnyagarwal008

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.