Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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/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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1070999]
help
Chatterbox?
[marto]: hey Corion, good weekend?
[prospect]: Thank you
[marto]: no problem prospect
[Corion]: I hope you all spent a good weekend!
[Discipulus]: good morning eumonks!
[Discipulus]: yes thanks, mostly at seaside, but the waterpolo tournemts went bad, very bad.. ;=(
[marto]: hey Discipulus, Corion a reasonable weekend. The boys first trip to the cinema
[Corion]: Discipulus: You got pushed too much under water?
[Corion]: marto: Oooh - cinema... I guess that's something I could do with my godson and sibling and sister as well, but I guess that getting a six year old and two four year olds into one movie is a tough sell ;)
[marto]: busy weekend, no me time :P

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2017-07-24 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (348 votes). Check out past polls.