in reply to Re^3: Creating wrapper over a wrapper
in thread Creating wrapper over a wrapper

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?

Replies are listed 'Best First'.
Re^5: Creating wrapper over a wrapper
by almut (Canon) on May 06, 2010 at 10:01 UTC

    This has nothing to do with with XS or not.  It's solely a matter of whether there's a prototype declared for the function.  The exact same problem exists for pure-Perl modules:

    #!/usr/bin/perl package ABC; sub new_time_var () { # ^^prototype print "ABC::new_time_var() called.\n"; } package PQR; sub new_time_var { ABC::new_time_var(); # prototype-compatible call --> works ABC::new_time_var(@_); # incompatible --> "Too many arguments for + ABC::new_time_var ..." } new_time_var();
Re^5: Creating wrapper over a wrapper
by Anonymous Monk on May 06, 2010 at 09:53 UTC
    Please express your question in code.

    Maybe you want to read perlsub again (esp section on prototypes)?

    $ perl -le" sub mysplice (\@$$@){ warn@_} sub QQQ(\@$$@) { goto &mysp +lice } QQQ @a, 1,1" ARRAY(0x97a064)11 at -e line 1.