G'day dideod.yang,

"Cpan give me many information about modules.. but function is not.."

Many modules provide nothing but functions. Here's a couple of examples:

$ perl -E 'use List::Util "max"; my @x = (5,3,1,6,2,4); say max @x' 6 $ perl -E 'use File::Spec; say for File::Spec::->splitdir("a/b/c")' a b c

I see ++atcroft has mentioned http://perldoc.perl.org/. If you look at the panel on the left-hand side, you'll see "Modules" and an alphabetical index. Follow the letter links and see a listing of module names (as links) as well as a short, one line description. These are all core modules which you should already have installed: try out the ones that interest you.

[I usually bookmark http://perldoc.perl.org/perl.html. It has the same panel with "Modules", "Functions", etc.; it also has direct links to all the Perl documentation. I find it suits me better; you can choose whatever you want.]

A word of caution. Some modules export a huge number of functions by default; limit that by importing only the functions you want (as I did with 'use List::Util "max";'). The POSIX module is possibly the worst offender; see its CAVEATS section. In general, modules tell you what they export by default; some provide tags to allow you to easily import related groups of functions — see Exporter, and in particular its "Specialised Import Lists" section, for more about this (most modules won't include this level of detail in their documentation).

— Ken


In reply to Re: Perl dictionary by kcott
in thread Perl dictionary by dideod.yang

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.