Experiments in Overloading
Let’s play with overloading a little. (Article experimenting with overloading operators in Perl, explaining a safe way to cast an overloaded object to a number.)
Let’s play with overloading a little. (Article experimenting with overloading operators in Perl, explaining a safe way to cast an overloaded object to a number.)
Consider the following fairly simple class, which creates a lookup object for month names…
Firstly, I’m not planning on breaking compatibility with Type::Params. The new API would live under a different namespace, such as Type::Params2. The API for Type::Params is currently: use feature ‘state’; use Type::Params qw( compile compile_named_oo ); use Types::Standard -types; sub…
Moose is great, but it does introduce a slight performance hit to your code. In the more than 15 years since it was first released, hardware improvements have made this less of a problem than it once was. Even…
The lighting in my bedroom uses Philips Hue bulbs — specifically, the coloured ones. Last night, I decided it would be nice to set the three lights in my bedroom to cycle slowly through a set of warm colours using…
So I like to keep local copies of my blogs.perl.org blog posts as Atom entries, but noticed yesterday that I had a few gaps in my collection. The Atom feeds offered by blogs.perl.org only have the most recent articles though,…
Mom is a shortcut for creating Moo classes (and roles). It allows you to define a Moo class with the brevity of Class::Tiny. (In fact, Mom is even briefer.) A simple example:…
Technically, I already announced it, but now I’ve renamed it. MooX::Pression is now called Zydeco. Moops had a memorable name, and I think the naming really helped it gain a following. MooX::Pression was just meh. So now it’s Zydeco. Zydeco…
The test suite for MooX::Pression used to run in 79 seconds on my laptop. Now it’s at 10 seconds. And no, I didn’t cut out any tests — I switched from using Keyword::Declare to a combination of Keyword::Simple and PPR….
Kind of like Moops but with less hacky parsing….
MooX::Press is a quick way of building a bunch of Moo roles and classes in one use statement. The most basic example would be: package MyApp { use MooX::Press class => [‘Foo’, ‘Bar’]; } my $thing1 = MyApp::Foo->new(); my…
Type::Tiny is probably best known as a way of having Moose-like type constraints in Moo, but it can be used for so much more. This is the seventh in a series of posts showing other things you can use…
Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the benefit of those of you who don't have their eyes permanently glued to the #moose IRC channel,…
Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the benefit of those of you who don't have their eyes permanently glued to the #moose IRC channel,…
Welcome to Planet Moose, a brief write up on what’s been happening in the world of Moose in the past month, for the benefit of those of you who don’t have their eyes permanently glued to the #moose IRC channel,…
Welcome to Planet Moose, a brief write up on what’s been happening in the world of Moose in the past month, for the benefit of those of you who don’t have their eyes permanently glued to the #moose IRC…
or Querying the Designated API of Perl Roles…
Welcome to Planet Moose, a brief write up on what’s been happening in the world of Moose in the past month, for the benefit of those of you who don’t have their eyes permanently glued to the #moose IRC…
Happy new year, and welcome to Planet Moose, a brief write up on what’s been happening in the world of Moose in the past month, for the benefit of those of you who don’t have their eyes permanently glued…
Acme-oop-ism is about writing code that works in Moose, Mouse and Moo. We’ve already looked at how Type::Tiny has achieved this. Now I’m going to introduce you to some Acme-oop-ist techniques….