#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; use IO::File; Main( @ARGV ); exit( 0 ); BEGIN { package Shack; use Moo; has( qw/ crabs is rw required 1 init_arg base /, builder => sub { warn "## BUILDER { @_ } @{[Data::Dump::pp( @_ )]}\n"; IO::File->new( $_[0] ) or die qq{"$_[0]": $!\n$^E\n }; }, ); $INC{'Shack.pm'} = __FILE__; } sub Main { use Shack; dd( Shack->new( base => __FILE__ ) ); dd( Shack->new( crabs => __FILE__ ) ); } __END__ bless({ crabs => "crabshack.pl" }, "Shack") ## BUILDER { Shack=HASH(0xc3f7ec) } bless({}, "Shack") "Shack=HASH(0xc3f7ec)": No such file or directory The system cannot find the file specified at crabshack.pl line 23.