moose

Using a Moose class

# construction
my $rect = Rectangle->new;

# r/w accessors
$rect->height(5);
$rect->width(15);  

# constructing w/ parameters
my $rect = Rectangle->new(
    x      => 10, 
    y      => 20,
    height => 5,
    width  => 15,
);

my $rect = Rectangle->new(height => 5, width => 15); 
# default values 
($rect->x, $rect->y); # 0, 0  
s | << | >> | i