in reply to Perl dictionary
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
|
|---|