[Catalyst] how could I pass a variable from Model to Controller?

redicaps at gmail.com redicaps at gmail.com
Tue Nov 18 07:49:06 GMT 2008

HI all:
I am a Catalyst beginner and run into this problem
since I have a model like this

package MyApp::Model::Trial;
use strict;
use warnings;

sub new{
my $pack =3D shift;
my $self =3D bless {
foo =3D> 'default value foo',
return $self;

sub get{
return shift->{'foo'};

how could I pass this "foo" to the controller?
I tried some code like this
my $a =3D $c->model('Trial::new');
$c->stash->{word} =3D $a->get;

my $a =3D $c->model('Trial');
$c->stash->{word} =3D $a->get;

both of them run into some exceptions

thx for helping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20081117/52f60=

More information about the Catalyst mailing list