Exceptions and debugging 

$canvas->draw_circle(
    x     => 100,
    y     => 250,
    color => '#ff0000',
);

# In .../Canvas.pm

sub draw_circle {
    my($self, %opt) = @_;
    my $radius = $opt{radius}
        or die "draw_circle needs radius";
    # ...
}
draw_circle needs radius at /path/to/Canvas.pm line 89