moose Questions

2

Solved

I'm trying to implement a Moose::Role class that behaves like an abstract class would in Java. I'd like to implement some methods in the Role, but then have the ability to override those methods in...
Gamelan asked 23/9, 2013 at 12:40

5

Solved

After having heard about new parts of the Perl ecosystem, such as Moose, DeclareX, and Catalyst, I thought that it'd be nice to take a look at Perl. Unfortunately, all of the introductory material ...
Kalynkam asked 18/11, 2009 at 20:42

5

Solved

I'm learning Modern perl - Moose, Plack etc. In much advices you can read "learn by examples" - so started searching for some ready-to-run applications written with Modern perl. Browsed much...
Belated asked 18/7, 2011 at 10:5

2

I'm an average perl programmer. I haven't problem with the language itself, but with the "good" object design. While I'm able understand (most of) CPAN modules, without serious problems, ...
Osteomyelitis asked 23/7, 2013 at 12:4

1

Solved

I am currently planning the design for a new system I will need to code that interacts with a back-end API. I was contemplating object composition and inheritance and decided that the most correct ...
Psychologism asked 2/7, 2013 at 6:54

3

Solved

I have a bunch of lazy features in a Moose object. Some of the builders require some time to finish. I would like to nvoke all the builders (the dump the "bomplete" object). Can I make all the la...
Begum asked 19/11, 2010 at 14:0

2

Solved

Using Moose, it's possible to create attributes having a default value. I have a set of attributes which all have a minimum, maximum and a default value. They are attributes representing a scale ...
Sigurd asked 27/5, 2013 at 19:29

5

Solved

By way of teaching myself Moose, I'm working on a Moose object that interfaces to a particular piece of hardware. Said hardware takes a number of different commands that set various properties of t...
Zepeda asked 28/1, 2013 at 20:48

9

Solved

There's a lot of buzz about MooseX::Method::Signatures and even before that, modules such as Params::Validate that are designed to type check every argument to methods or functions. I'm considering...
Cleary asked 24/2, 2010 at 23:55

4

Solved

I was wondering if it is possible to make sure a method in a class I make will NOT be monkey patched (Monkey patch). Can Moose achieve this? Consider the following: { package Foo; sub hello{pri...
Henryhenryetta asked 23/2, 2012 at 14:51

6

Solved

From the current version (0.98) of the Moose::Manual::MooseX are the lines: We have high hopes for the future of MooseX::Method::Signatures and MooseX::Declare. However, these modules, while ...
Intinction asked 23/2, 2010 at 22:15

3

Although I am not a Perl guru, I use Perl and I can write object-oriented programs the "good old" way. Now I would like to learn Moose. I've already (so-as) chewed the basic documentation, a...
Pulsation asked 23/9, 2012 at 11:38

4

Solved

I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most] while doing so. As I started I figured out I could really use a couple of Moose roles to dec...
Kwabena asked 14/5, 2010 at 17:45

1

Solved

If I declare lazy attribute in perl class using Moose, and the attribute is using builder: has 'colors' => ( is => 'rw', isa => 'ArrayRef', lazy => 1, builder => '_build_colors'...
Benzofuran asked 16/6, 2012 at 21:38

1

Solved

I've written a simple Moose based class called Document. This class has two attributes: name and homepage. The class also needs to provide a method called do_something() which retrieves and retur...
Wickerwork asked 8/6, 2012 at 19:16

3

Solved

Let's say I have a codebase with a bunch of Moose-based classes and I want them all to use a common set of MooseX::* extension modules. But I don't want each Moose-based class to have to start like...
Hawger asked 18/4, 2012 at 19:10

3

Solved

Ok just to sanity check overload doesnt seem to be working for me. I don't know if it's the version of perl I have, or the version of overload.pm, or something wrong with how I've implemented it, b...
Delphinus asked 12/10, 2011 at 3:18

3

Solved

I of course know that I can rename the init arg for an attribute by setting init_arg (e.g) package Test { use Moose; has attr => ( is => 'ro', isa => 'Str', init_arg => 'attribut...
Otto asked 7/4, 2012 at 2:14

5

Solved

I would like some attributes (perhaps this is the wrong term in this context) to be private, that is, only internal for the object use - can't be read or written from the outside. For example, thi...
Nevermore asked 22/10, 2010 at 11:52

1

Solved

An often seen recommendation on best practices regarding Moose is the following: "The use namespace::autoclean bit is simply good code hygiene, as it removes imported symbols from your class's n...
Alsacelorraine asked 4/3, 2012 at 21:41

3

Solved

I understand that using builder enables subclasses to override attribute defaults easily and roles can require them. This can also be accomplished using default like so: has 'foo' => is => ...
Idolize asked 2/3, 2012 at 0:26

2

My original question was too vague and was "closed as not constructive." As such, I will revise the question so that it caters to the answers that have already been posted. :-) I am interest...
Ilysa asked 8/2, 2012 at 1:49

1

Solved

What's wrong with the code below ? When run, I get: "Use of uninitialized value in concatenation (.) or string at ./main.pl line 14" #!/usr/bin/perl package Test; use Moose; has 'message' =>...
Continual asked 16/1, 2012 at 17:28

3

Solved

Moose is very lovely, but sometimes simple typos can cause hair-raisingly exciting long stacktraces with, from my point of view, zero useful content. So, are there any tools to interpret this expl...
Nickinickie asked 29/5, 2011 at 23:59

2

Solved

I've been a proponent of adopting Moose (and MooseX::Declare) at work for several months. The style it encourages will really help the maintainability of our codebase, but not without some initial ...
Iggy asked 2/12, 2010 at 23:33

© 2022 - 2024 — McMap. All rights reserved.