Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2016-10-26 00:13 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (330 votes). Check out past polls.