From: Dave Rolsky Date: Thu, 8 Jul 2010 23:26:30 +0000 (-0500) Subject: No need for "find or create" logic on class types. X-Git-Tag: 1.09~60 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9278543f1ea317f5d006c32beac5e76a1d4b944f;p=gitmo%2FMoose.git No need for "find or create" logic on class types. It's safe to call class_type('Foo') repeatedly, so why complicate things. --- diff --git a/lib/Moose/Manual/Types.pod b/lib/Moose/Manual/Types.pod index 41a5d61..a032b18 100644 --- a/lib/Moose/Manual/Types.pod +++ b/lib/Moose/Manual/Types.pod @@ -426,16 +426,6 @@ define I of your custom types in one module, C. Second, load this module in all of your other modules. -If you are still having load order problems, you can make use of the -C function exported by -L: - - class_type('MyApp::User') - unless find_type_constraint('MyApp::User'); - -This sort of "find or create" logic is simple to write, and will let -you work around load order issues. - =head1 AUTHOR Dave Rolsky Eautarch@urth.orgE