Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Getting Started with Moose

by jdporter (Canon)
on Aug 06, 2008 at 20:57 UTC ( #702738=perlmeditation: print w/ replies, xml ) Need Help??

Getting Started with Moose

I recently decided to get with the program and use Moose in my current/impending projects. All the cool kids are doing it!

I immediately hit a roadblock: I'm using ActiveState Perl, and their repository does not have Moose. (Apparently they had some problems building it.)

So I went searching, got help, and resolved my problems. Now I have Moose installed. Here's how I did it, and below are links to essential Moose-related resources.

But first, I want to mention something which I found confusing: MooseX. What is MooseX? How is it different from Moose?

MooseX is a namespace for Moose eXtensions which are not part of the Moose package proper. You will find a large number of Moose extensions in the MooseX namepace on CPAN.

Windows: ActiveState Perl 5.8

  1. If you don't already know how to, read A guide to installing modules for Win32.
  2. Add the following repository to your configuration:
    http://theoryx5.uwinnipeg.ca/ppms/package.xml
    You can name it "kobes".
  3. While viewing all packages (vs. viewing installed packages), find "Moose" in the list, and install it. (Type  ppm install Moose to circumvent the gui.)
This will install Moose and a number of dependencies.

Alternative ppm repositories are available; see http://theoryx5.uwinnipeg.ca/ppms/ for some suggestions.

Windows: ActiveState Perl 5.10

  1. If you don't already know how to, read A guide to installing modules for Win32.
  2. Add the following repository to your configuration:
    http://cpan.uwinnipeg.ca/PPMPackages/10xx/package.xml
    You can name it "kobes".
  3. While viewing all packages (vs. viewing installed packages), find "Moose" in the list, and install it. (Type  ppm install Moose to circumvent the gui.)
This will install Moose and a number of dependencies.

Alternative ppm repositories are available; see http://cpan.uwinnipeg.ca/PPMPackages/10xx/ for some suggestions.

Other platforms, including Strawberry Perl on Windows

ActiveState Perl has its own way of doing things; the rest of the world uses a module installation tool called cpan.
Please read A Guide to Installing Modules if you are not familiar with it.

Install Moose by typing   install Moose   at the cpan> prompt.
This will install Moose and a number of dependencies directly from CPAN.

Windows: Camelbox Perl

If you're using Camelbox, you're in luck: Moose is pre-packaged with the perl installation. However, you may still wish to install some Moose extensions, which are not-prepackaged with Camelbox.

Resources

Comment on Getting Started with Moose
Select or Download Code
Re: Getting Started with Moose
by Your Mother (Canon) on Aug 06, 2008 at 23:20 UTC

    (update: I should have prefaced with: "Nice post.")

    I took the plunge two weekends back. I haven't used any of the sophisticated pieces yet (and I'm just running Mouse for now so I can know when I hit the "wall" between the two). What impresses me the most is not how clean the object system is but that it is so easy and wraps up other object classes so well that it encourages its use in plain old short programs and maybe even one-offs. Don't know how much I'll be using it but I love it so far and probably only using 20% of the features. I think Dave Roslky just expanded the docs a couple days ago too; I haven't had a chance to check. Very cool.

Re: Getting Started with Moose
by tod222 (Pilgrim) on Aug 07, 2008 at 20:11 UTC
    I've been using Moose for 4 months and highly recommend it. While I'm hardly an expert, with Moose it was easy to create code to process the parsetree produced by Parse::RecDescent's 'autotree' directive.

    Also, the support on the mailing list (moose@perl.org) and on irc (#moose) is spectacular.

    I've been using Moose on Linux, but am happy to see this information for using it on Windows.

Re: Getting Started with Moose
by dHarry (Abbot) on Aug 08, 2008 at 14:41 UTC

    I use ActiveState’s Perl 5.8.8 and for me the installation of Moose on Windows was very simple. I added "http://ppm.tcool.org/archives/" (or put here the URL of any repository of Win32 PPM packages) to the list of repositories and used the GUI to select and install Moose and all related packages. Check http://ppm.tcool.org/intro/register for details. No need to circumvent de GUI:-) I have tried a few examples from the Moose CookBook and it works fine.

Re: Getting Started with Moose
by stvn (Monsignor) on Aug 08, 2008 at 23:10 UTC

    jdporter

    Nice post, I appreciate that you took the time to document this (and discuss details with us on #moose too) ++ you for all that :)

    The only one comment I have is that the "Programming with Moose" book is not really recommended anymore. While it has some good parts to it, it also has some horribly wrong misunderstandings of Moose and the author has not been terrible cooperative in fixing them (and seems to have largely abandoned the effort too). The Cookbooks (recently re-organized and updated by Dave Rolsky) are really the better place to go, followed by merlyns articles and the talk slides found on http://moose.perl.org.

    -stvn
      it has some good parts to it
      It does?
Re: Getting Started with Moose
by Erez (Curate) on Aug 11, 2008 at 08:19 UTC

      You must be talking only about Perl 5.10. Sorry, I didn't try that. I successfully installed Moose for Perl 5.8 from one of the repositories mentioned.

      Between the mind which plans and the hands which build, there must be a mediator... and this mediator must be the heart.
      I just uploaded a Moose ppm package for perl-5.10 to the cpan.uwinnipeg.ca repository.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://702738]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-11-28 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (198 votes), past polls