Hi Gabor

The monastery's authority for such questions is dave_the_m and IIRC we already briefly talked about introspection here.

Regarding a (robust) API:

IIRC this is depending on the version of Perl, early versions compiled code into the function block to expand @_, later versions had dedicated OP-Codes for that. ( I could dig up that info from emails, if Dave doesn't show up)

so this could either boil down to inspecting the OP-Tree with B::Concise or calling a method from B (on a B::CV node most likely)

In any case, B::Deparse is written in Perl, so you can always look into it and diff different versions to locate how the info is extracted.

Whatever the result it would be nice if such an API was added to Sub::Util when it's not experimental anymore.

HTH :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

PS: This message will self-implode ASA Dave shows up ;-)


In reply to Re: Introspecting function signatures by LanX
in thread Introspecting function signatures by szabgab

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.