How do you use Mouse with a short example?

Perl, Mouse, Object-Oriented, Perl Module, Example
This example demonstrates how to use Mouse, a lightweight object-oriented system for Perl. Mouse provides a simple and efficient way to create Perl classes and objects.
#!/usr/bin/perl use strict; use warnings; use Mouse; # Define a simple class with Mouse package Animal; use Mouse; has 'name' => ( is => 'rw', isa => 'Str', ); sub speak { my $self = shift; return "My name is " . $self->name; } # Create an instance of Animal my $dog = Animal->new(name => 'Buddy'); print $dog->speak(); # Outputs: My name is Buddy

Perl Mouse Object-Oriented Perl Module Example