Daniel McBrearty wrote:
I have a method in a model that goes like this:

sub do_something {
   my ($self, $my_var) = @_;

   $my_var = MyApp->context->stash->{my_var} unless defined $my_var;
   die "my_var not defined" unless defined $my_var;

Plugin::Singleton considered a really, really, really bad idea.

Don't use it.

Implement COMPONENT or ACCEPT_CONTEXT (see Catalyst::Component) as appropriate instead.

--
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to