Commits

Toby Inkster  committed 23a15dd Draft

bundle example from synopsis

  • Participants
  • Parent commits 44dcc72

Comments (0)

Files changed (2)

File examples/synopsis.pl

+use strict;
+use warnings;
+
+{
+   package Local::Role;
+   use MooseX::RoleQR;
+   after qr{^gr} => sub {
+      print " World\n";
+   };
+}
+ 
+{
+   package Local::Class;
+   use Moose;
+   with qw( Local::Role );
+   sub greet {
+      print "Hello";
+   }
+}
+ 
+Local::Class->new->greet; # prints "Hello World\n"

File lib/MooseX/RoleQR.pm

       package Local::Role;
       use MooseX::RoleQR;
       after qr{^gr} => sub {
-         print "World\n";
+         print " World\n";
       };
    }