in reply to Moo error message not understood
can be inlined asuse Some::Module;
BEGIN { ... Contents of Some/Module.pm ... $INC{'Some/Module.pm'} = 1; } use Some::Module;
(There are differences, such as lexical pragmas before the BEGIN block will also affect the BEGIN block, but it's a good starting point.)
So what you want:
use strict; use warnings; use diagnostics; use 5.014; BEGIN { package Lib::Book; use Moo; has isbn => ( is => 'rw', ); $INC{"Lib/Book.pm"} = 1; } use Lib::Book; my $newbook = Lib::Book->new( isbn => 'ISBN', ); say $newbook->isbn;
|
|---|