moose Questions

1

Solved

The documentation for the lazy_build feature in Moose has this to say: Note that use of this feature is strongly discouraged. Some documentation used to encourage use of this feature as a best pra...
Phlox asked 23/7, 2022 at 11:8

6

Solved

I'm going into writing some crawlers for a web-site, the idea is that the site will use some back-end Perl scripts to fetch data from other sites, my design (in a very abstract way..) will be to wr...
Nearsighted asked 17/6, 2011 at 22:14

1

Created a package and wanted to use signatures. package Foo; use strict; use warnings; use feature qw(signatures); no warnings qw(experimental::signatures); use Moose; has bar => ( is => 'r...
Riker asked 28/10, 2021 at 20:49

2

As the Dan's suggestion, i tried to edit this post Error occurred at setting up MOOSE tracker, I also don't know why this error happened because i installed the Opencv-contrib-python==4.5.1.48.Howe...
Intoxicate asked 19/4, 2021 at 9:16

1

I am trying to understand how lexical_has attributes work in Moops. This feature comes from Lexical::Accessor and, as I understand it, the lexical_has function is able to generate a CODE reference ...
Johnajohnath asked 19/12, 2014 at 2:38

4

Solved

I'm writing a module for a moose object. I would like to allow a user using this object (or myself...) add some fields on the fly as he/she desires. I can't define these fields a priori since I sim...
Frustrated asked 22/10, 2010 at 10:48

3

Solved

I'm working on a Mojo app and I'd like to be able to consume some Moose roles to make my life easier. On CPAN I see MojoX::Moose::Controller, which has very simple internals. I don't see much else...
Refuel asked 12/6, 2015 at 13:54

2

Solved

I'm currently delegating the builder method to all of the objects that extend one of my base classes. The problem that I'm facing is I need all of the objects to either read an attribute of itself ...
Incondensable asked 20/7, 2010 at 14:38

3

Solved

Using Perl and Moose, object data can be accessed in 2 ways. $self->{attribute} or $self->attribute() Here is a simple example demonstrating both: # Person.pm package Person; use strict; use...
Quiff asked 14/9, 2015 at 19:26

2

Solved

I am new to Moose and doing quite well until I have hit a snag using a PDL as a property. I want to be able to write an object to a file (I have been using use MooseX::Storage; with Storage('io' =&...
Agnate asked 23/5, 2011 at 19:15

3

Solved

Reformulating the question, because @optional asked me it wasn't clear and linked one HTML::Mason based solution Four easy steps to make Mason UTF-8 Unicode clean with Apache, mod_perl, and DBI ,...
Auto asked 2/5, 2011 at 14:47

4

I have a Moose class that needs to send requests of type Foo::Request. I need to make this dependency accessible from the outside, so that I can easily exchange the request implementation in tests....
Denadenae asked 19/8, 2011 at 7:38

4

Solved

POSTLUDE MooseX::Declare would no longer be recommended by anyone as it relies on Devel::Declare which served its purpose but is itself obsolete. At this point if anyone wants MX::D they should lo...
Rumelia asked 11/5, 2011 at 14:32

2

Solved

I often work on a huge, not-very-well-documented, object-oriented Perl repo at my place of employment. While maintaining the code, I frequently need to trace things that are inherited from other cl...
Shiflett asked 6/3, 2015 at 0:42

2

Solved

I am currently working at a company, where we are doing Perl development. However the code is really messy, uses really old Perl idioms, so I've decided to slowly clean it up and teach my coworkers...
Sentimentalize asked 5/3, 2015 at 12:1

5

Solved

The documentation with the module itself is pretty thin, and just tends to point to MOP.
Garold asked 17/9, 2008 at 2:33

4

Solved

A hashtable is the typical initializer for your Perl objects. Now your input is unreliable in that you don't know whether for any given key there'll be a defined value, nor whether the key is there...
Epinasty asked 28/4, 2011 at 19:4

2

Solved

In this answer I found a recommendation for a simple TO_JSON method, which is needed for serializing blessed objects to JSON. sub TO_JSON { return { %{ shift() } }; } Could anybody please explai...
Armoury asked 26/8, 2014 at 14:21

4

Reworded question - sorry, it is a bit long. Have a simplyfied package for example package My; use Moose; use namespace::sweep; sub cmd1 {1} sub smd2 {2} __PACKAGE__->meta->make_immutable; ...
Doyle asked 20/8, 2014 at 9:35

2

Solved

I found it rather difficult to find information about how to assemble a DBIx::Class schema structure using Moose. How to do that correctly (essentially working) and in modern Perl (good style, fast...
Fun asked 18/3, 2014 at 15:1

3

Solved

I've received a lot of exceptions from QA due to incomplete data being fed to my Moose constructors. The attribute name is present in the constructor arguments, but the value is undef. It's a fact...
Ralph asked 23/6, 2011 at 16:57

3

I have two object attributes which require expensive calculations, so I'd like them to be lazy. They're most efficiently calculated together, so I'd like to calculate them at the same time. Does Mo...
Gasparo asked 6/3, 2014 at 20:9

3

Solved

I'm having a really hard time understanding the intersection of OO Perl and my $self = shift; The documentation on these individual elements is great, but none of them that I've found touch on how ...
Excommunicatory asked 3/10, 2013 at 14:29

1

Solved

What is the typical approach for custom initialization of certain attributes when using Moose? For instance, suppose I take two dates in string format as input to my class: has startdate => ...
Bromley asked 28/2, 2014 at 19:40

1

Solved

I want to fetch elements from a list that is stored inside a Moose class. The class knows how to populate that list itself. It's sort of like an iterator, except that I want to be able to reset the...
Haugh asked 12/2, 2014 at 12:57

© 2022 - 2024 — McMap. All rights reserved.