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...
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 ...
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...
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, ...
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...
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...
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 ...
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...
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...
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...
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...
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...
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...
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 => ...
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...
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' =>...
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...
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 ...
© 2022 - 2024 — McMap. All rights reserved.