tag:blogger.com,1999:blog-876358347971598886.post3098464960358922382..comments2023-03-25T16:20:46.021+03:00Comments on nothingmuch's perl blog: Simplifying BEGIN { } with Moose rolesnothingmuchhttp://www.blogger.com/profile/03855760206940108541noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-876358347971598886.post-78691245015172037212009-12-04T03:10:27.194+02:002009-12-04T03:10:27.194+02:00It only ever runs once, so it doesn't need to ...It only ever runs once, so it doesn't need to be optimized per se, but 'maybe' looks like a very handy module nonetheless =)nothingmuchhttps://www.blogger.com/profile/03975438115490089158noreply@blogger.comtag:blogger.com,1999:blog-876358347971598886.post-41955109299521756622009-12-04T03:00:59.263+02:002009-12-04T03:00:59.263+02:00You can do:
use maybe 'Foo';
with ma...You can do:<br /><br /> use maybe 'Foo';<br /><br /> with maybe::HAVE_FOO<br /> ? "MyClass::Bar::Foo"<br /> : "MyClass::Bar::Fallback";<br /><br />The maybe::* is a constant value so this statement will be optimized by compilator.Anonymoushttps://www.blogger.com/profile/09811096077823977022noreply@blogger.com