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.

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.

[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/

Reply via email to