Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Moo error message not understood

by ikegami (Pope)
on Jan 17, 2014 at 18:28 UTC ( #1070999=note: print w/replies, xml ) Need Help??

in reply to Moo error message not understood

use Some::Module;
can be inlined as
BEGIN { ... Contents of Some/ ... $INC{'Some/'} = 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/"} = 1; } use Lib::Book; my $newbook = Lib::Book->new( isbn => 'ISBN', ); say $newbook->isbn;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1070999]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2017-02-27 05:12 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (376 votes). Check out past polls.