Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Perl dictionary

by kcott (Archbishop)
on Jul 20, 2018 at 11:51 UTC ( [id://1218893]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found