in reply to Creating wrapper over a wrapper

Try

use ABC ();

i.e., don't import the original functions into your PQR namespace, if you're going to define wrapper functions of the same name.

(When writing just "use ABC;" the functions are automatically imported because they are in the @EXPORT array (as opposed to @EXPORT_OK) — see Exporter.)

Replies are listed 'Best First'.
Re^2: Creating wrapper over a wrapper
by sunnyagarwal008 (Initiate) on May 06, 2010 at 05:45 UTC
    use ABC ();
    This also doesn't work. I still get errors.
    Too many arguments for ABC::new_time_var at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/ABC.pm line 71, near "@_)"

    Not enough arguments for ABC::dl_ascii_to_time at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/Deshaw/ABC.pm line 81, near "@_)"

    Not enough arguments for ABC::dl_compare at /u/agarwsun/projects/packages/datelib/lib/perl5/5.8.6/i86pc-solaris/Deshaw/ABC.pm line 91, near "@_)"

    The actual signatures of these subroutines are:
    <new_time_var>() <dl_ascii_to_date>(<string>) <dl_ascii_to_time>(<string>, <dtp>)

      Well, if the ABC::new_time_var function is declared with a prototype of (), meaning no arguments, you cannot call it with arguments in your wrapper, like ABC::new_time_var(@_).  Similarly for the other two functions.

      See also other threads on using prototypes here, to better understand how prototypes work in Perl (hint: they don't act like in C).

        But how come then passing @_regardless the number of arguments function expects, works fine in case we write a wrapper over a pure perl module?