Some of you might have already heard about Padre, the Perl IDE I have started to write.

I am not sure if the more experienced users will need the calltip feature but it seems that when you are a beginner and type a perl command it helps if your editor shows you what parameters can you give to that function.

I created a screenshot showing an example on Padre 0.08.

So far what I did was creating a hash such as this:

my %keywords = ( chomp => '(STRING)', substr => '(EXPR, OFFSET, LENGTH, REPLACEMENT)', index => '(STR, SUBSTR, INDEX)', pop => '(@ARRAY)', psush => '(@ARRAY, LIST)', print => '(LIST) or (FILEHANDLE LIST)', join => '(EXPR, LIST)', split => '(/PATTERN/,EXPR,LIMIT)', wantarray => '()', );
The question is if I have to create this mapping for all the functions or if I can fetch it from somewhere?

I looked at the perlfunc.pod and for every function it has several =item funcname PARAMS entries providing all the possible paramters.

I might build the list from there on the fly but I think it might be better to put the examples in order of how common they are or show only the most common one to reduce confusion.

In case you wonder, if I create a mapping, I'll certainly will make it separate from Padre so other IDEs or editors will be able to use it.

Actually this might be interesting to and advanced user as well especially when she is looking at functions or methods she does not use often.

I wonder if the same functionality could be or should be provided for standard modules too? What about the general case of CPAN? What about DarkPAN, that is modules in companies or otherwise not on CPAN?
Can we define some way to fetch the signature of functions from the documentation of the module?

What do you think? How should this be solved?


In reply to Calltips for Padre 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.