On Jan 10, 2008, at 3:15 PM, Octavian Rasnita wrote:
From: "Ash Berlin" <[EMAIL PROTECTED]>
How did you get to a function in MyApp.pm during a request....
# in MyApp.pm
sub foobarbaz {
my ($c) = @_;
}
# In controller code.
$c->foobarbaz();
Make sense?
Not really.
I've tried (in MyApp.pm):
sub the_host {
my ($c) = @_;
return $c->req->hostname;
}
and then I've tried to use
cookie_domain => the_host()
in the MyApp config, but when I try to start the server it gives an
error telling that I can't use the method "req" because $c is
undefined.
Because you didn't define it. You have to call it as a method ($c-
>the_host()), and you have to call it *during a request*. I don't
know how you still expect to be able to get a value that is sent by
the browser during startup when there is no browser.
--
Jason Kohles, RHCA RHCDS RHCE
[EMAIL PROTECTED] - http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/