Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Problem installing packages

by tobyink (Canon)
on Apr 03, 2012 at 08:07 UTC ( [id://963188]=note: print w/replies, xml ) Need Help??


in reply to Problem installing packages

The separator used for packages is "::". (Alternatively a single quote can be used, though this is rare.) For example: Win32::Unicode or Win32'Unicode.

By convention, packages tend to be stored in modules (i.e. files ending in ".pm") named by replacing the "::" with a directory separator, which will be operating system specific - e.g. "\" on Windows. So the Win32::Unicode package would be stored in a file called "Win32\Unicode.pm".

The syntax of Perl's require and use keywords strongly encourages the above convention.

Lastly there are distributions (a.k.a. releases) which are bundles of modules, scripts, documentation and other supporting files. What CPAN (and PPM) provide are distributions. The convention with distributions is to name them after the most important package contained within them, replacing "::" with a dash.

So the Win32::Unicode package would usually be inside a file called Win32/Unicode.pm which would be distributed as part of the Win32-Unicode distribution.

Somewhat confusingly, the PPM interface and documentation often refers to distributions as "packages".

It seems that ppm query expects to be given a distribution name to query (i.e. with a dash), but ppm install expects a package name (i.e. with "::").

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found