X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2Fouse.pm;h=cebb5f944c36eaf53acac1d373691493f1d0b89a;hp=a237ee8b47043a367605cfad718e65d8defb37b6;hb=ebe91068002fbe34a924a0a9e2cd79553867938c;hpb=6052a73acc3caae1229bc6310040c11427bb23c1 diff --git a/lib/ouse.pm b/lib/ouse.pm index a237ee8..cebb5f9 100644 --- a/lib/ouse.pm +++ b/lib/ouse.pm @@ -1,7 +1,6 @@ package ouse; -use strict; -use warnings; +use Mouse::Util; # enables strict and warnings BEGIN { my $package; @@ -9,18 +8,15 @@ BEGIN { $package = $_[1] || 'Class'; if ($package =~ /^\+/) { $package =~ s/^\+//; - eval "require $package; 1" or die; + Mouse::Util::load_class($package); } } use Filter::Simple sub { s/^/package $package;\nuse Mouse;\n/; } } 1; - __END__ -=pod - =head1 NAME ouse - syntactic sugar to make Mouse one-liners easier @@ -37,18 +33,18 @@ ouse - syntactic sugar to make Mouse one-liners easier =head1 DESCRIPTION -ouse.pm is a simple source filter that adds C +F is a simple source filter that adds C to the beginning of your script and was entirely created because typing -perl -e'package Foo; use Mouse; ...' was annoying me... especially after +perl C<< -e'package Foo; use Mouse; ...' >> was annoying me... especially after getting used to having C<-Moose> for Moose. =head1 INTERFACE -ouse provides exactly one method and it's automically called by perl: +C provides exactly one method and it is automatically called by perl: =over 4 -=item B +=item C<< oose->import() >>> Pass a package name to import to be used by the source filter. @@ -62,11 +58,9 @@ You will need L and eventually L None reported. But it is a source filter and might have issues there. -=head1 BUGS +=head1 SEE ALSO -All complex software has bugs lurking in it, and this module is no -exception. If you find a bug please either email me, or add the bug -to cpan-RT. +L for C<< perl -Moose -e '...' >> =head1 AUTHOR