Re: [Catalyst] problem on $c-res-body(*STDOUT);

2008-03-14 Thread Andy Grundman


On Mar 14, 2008, at 5:57 AM, Matt Lawrence wrote:


Fayland Lam wrote:

sub test_body : Local {
  my ($self, $c) = @_;

  $c-res-body(*STDOUT);
  print a\n;
  print b\n;
}



Have you tried passing the glob as a reference?

$c-res-body(\*STDOUT);

It looks like that's at least part of your problem. I suspect that  
using filehandles in this way is not going to work as you expect and  
may have engine-specific problems, have you considered using $c-res- 
write as a substitute for print?


Yeah, don't do that, you should use $c-res-write(a\n); etc.




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


[Catalyst] problem on $c-res-body(*STDOUT);

2008-03-13 Thread Fayland Lam

sub test_body : Local {
   my ($self, $c) = @_;

   $c-res-body(*STDOUT);
   print a\n;
   print b\n;
}

I get:

a
b
HTTP/1.0 200 OK
Cache-Control: no-cache, must-revalidate, max-age=0
Connection: keep-alive
Date: Fri, 14 Mar 2008 02:58:50 GMT
Pragma: no-cache
Content-Length: 31
Set-Cookie: zorpia_session=6ef8f841a6f678e09621936e10c52f33eb442f57; path=/
Status: 200
X-Catalyst: 5.7012

*Catalyst::Engine::HTTP::Remote

how to get the correct stuff. I tried to call $c-finalize_headers(); 
before -body, no help.


Thanks.

--
Fayland Lam // http://www.fayland.org/ 
Foorum based on Catalyst // http://www.foorumbbs.com/ 



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