misterb101 has asked for the wisdom of the Perl Monks concerning the following question:
Hi fellow Perl mates,
I am working on a big application using ExtJS as a front-end. The interface communicates with the backend using Ext::Direct, a JSON API.
What I am trying to do is create the API specification automatically. The API basically requires 2 things. specify which subroutines are made accessible and how many parameters they take, which I am solving like this:
The subroutine attribute is not a problem, but I can't seem to figure out how I can list how many arguments the subroutine requires:sub foo($$) : Direct { ... }
can anyone implement the 'GiveMeTheNumberOfRequiredArgumentsOf' subroutine for me ;) ? THANKSmy $numArgs = GiveMeTheNumberOfRequiredArgumentsOf(\&foo);
--
Cheers,
Rob
Cheers,
Rob
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: subroutine introspection
by JavaFan (Canon) on Dec 22, 2010 at 16:32 UTC | |
by misterb101 (Sexton) on Dec 22, 2010 at 19:29 UTC | |
Re: subroutine introspection
by ikegami (Patriarch) on Dec 22, 2010 at 17:32 UTC |
Back to
Seekers of Perl Wisdom