role application works for a simple case
[gitmo/Moo.git] / lib / oo.pm
CommitLineData
79cfb919 1package oo;
2
3use strictures 1;
4use Moo::_Utils;
5
39d272e7 6sub moo {
7 print <<'EOMOO';
8 ______
9< Moo! >
10 ------
11 \ ^__^
12 \ (oo)\_______
13 (__)\ )\/\
14 ||----w |
15 || ||
16EOMOO
17 exit 0;
18}
19
79cfb919 20BEGIN {
21 my $package;
22 sub import {
39d272e7 23 moo() if $0 eq '-';
79cfb919 24 $package = $_[1] || 'Class';
25 if ($package =~ /^\+/) {
26 $package =~ s/^\+//;
27 _load_module($package);
28 }
29 }
30 use Filter::Simple sub { s/^/package $package;\nuse Moo;\n/; }
31}
32
331;