Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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;

Comment on Re: Moo error message not understood
Select or Download Code

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 imbibing at the Monastery: (5)
As of 2015-11-27 10:06 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (722 votes), past polls