Get started with Perl 6 one liners
One liners in Perl are better than ever
Stratopan is a cloud-based Perl module repository service. Users can create repositories of modules in the cloud and use them to manage their local installations of Perl modules. This makes it easy to configure a network of machines to have exactly the same modules (and versions), deploy Perl applications quickly and cleanly and host private (i.e. non CPAN) Perl software in a secure, central location. The Stratopan beta has officially started and so there has never been a better time to check out this amazing service. Read on for an unofficial quick start guide to Stratopan!
Head over to Stratopan, sign up to create a new account and login. You should be presented with this message:
Click the create repository link and complete the information on the following screen. Be sure to select the private option if you want your repository not to be publicly visible.
You should now have a new repository.
Modules reside in "stacks" which belong to a repository and helpfully Stratopan creates a default "master" stack for you. To insert modules into a stack you can "pull" them from CPAN or "add" them from a local machine. Let's start by pulling a module onto our master stack. Click the "pulling" link to launch the pull module screen and start typing the name of the module you want to pull. Note that this must be the distribution name and not the module name. For example to pull the module "Method::Signatures", you should type "Method-Signatures". Helpfully Stratopan provides a case-insensitive predictive text search and lists the module version numbers available too, in case you need a specific variant. Let's pull my wildly unpopular WWW::CheckHTML module:
Decide if you want Stratopan to recursively pull all module dependencies; this is usually a good option. What's nice about this is the "recursive" pull will grab all the modules dependent on your chosen module's dependencies.
It can be surprising how many dependencies there are - for example WWW::CheckHTML has 5 direct dependencies and 69 indirect ones. Obviously when there are more dependent modules, Stratopan will take longer to pull them into the stack (usually a minute or two). When it's finished, Stratopan will present the the latest view of the stack.
Stratopan provides some useful stack features. A link to metapcan is provided for every module (except for private modules that have been added from a local machine) and it's possible to browse the *.pm files in a module by clicking on it:
Each stack has it's own commit history, accessed via the aptly-named "history" link:
The "graphs" link is much more interesting. It opens this cool, rotatable dependencies chart:
Finally the "settings" link let's you update the stack name, description and target Perl version. You can also delete the stack from here.
To install modules from Stratopan you'll need cpanm. You can install this via cpan from the terminal:
Once cpanm has installed, open one of your stacks on Stratopan and copy the stack URL (shown in red below).
At the terminal type "cpanm --mirror-only --mirror " and paste your copied stack URL and enter one or more module names that you wish to install. For example to install WWW::CheckHTML from my master stack:
cpanm --mirror-only --mirror https://stratopan.com/sillymoose/WebStuff/master WWW::CheckHTML
If all goes well you should see the following installation dialogue:
--> Working on WWW::CheckHTML Fetching https://stratopan.com/sillymoose/WebStuff/master/authors/id/S/SI/SILLYMOOS/WWW-CheckHTML-0.04.tar.gz ... OK Configuring WWW-CheckHTML-0.04 ... OK Building and testing WWW-CheckHTML-0.04 ... OK Successfully installed WWW-CheckHTML-0.04 1 distribution installed
Stratopan is an awesome new service which can hugely simplify the configuration of your Perl platforms. Hopefully this guide has given you a better idea of how to get started with it!