package Karl::Fractals::Mandelbrot; use Moo; use strictures 1; use namespace::clean; use Inline C => 'DATA'; sub reckon { my ( $self, $x, $y ) = @_; mandelbrot( $x, $y ); } has iterations => ( is => 'ro', default => 20 ); has width => ( is => 'ro', default => 1280 ); has height => ( is => 'ro', default => 1024 ); 1; __DATA__ __C__ /* fake */ int mandelbrot(int x, int y) { return x*y; } #### #!/usr/bin/env perl use strict; use warnings; use lib q(.); use Karl::Fractals::Mandelbrot; use feature qw (say); use Data::Dump; my $Benoit = Karl::Fractals::Mandelbrot->new(); dd $Benoit; say $Benoit->reckon( 2, 7 ); __END__ karls-mac-mini:monks karl$ ./inline_moo.pl bless({ height => 1024, iterations => 20, width => 1280 }, "Karl::Fractals::Mandelbrot") 1280 1024 20 14