The way that the DATA file handle works is intimately involved with how Perl loads files via do/require/use. What you are attempting will not work. Load your file using do/require/use; not eval.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Comment on Re: Losing __DATA__ when evaling script.