[Catalyst] $c->comp($name) fails to return the correct class
Matt S Trout
dbix-class at trout.me.uk
Sat Sep 24 16:38:21 CEST 2005
On Sat, Sep 24, 2005 at 09:45:06PM +0800, Alan Tam wrote:
> >>Anyone can tell me what did I do wrong? Thanks a lot!
> Thanks for your pointer! No matter I agree with whether regex is good or
> bad, no reason can we cast the class to its boolean context.
> Given my limited perl knowledge, I can workaround by either patching
> Class::DBI to always return true or Catalyst::Engine to use defined().
> Any more choice for me?
my $comp = $c->comp('M::Book$');
This is the approach I use and not only works for Class::DBI stuff but means
your components get a head-start on portability between apps.
Matt S Trout Specialists in perl consulting, web development, and
Technical Director UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Catalyst