On Apr 30, 2008, at 11:51 AM, Emmanuel Quevillon wrote:

Hi,

I'd like to incorporate an action into an <object> tag that only prints some data (XML SVG).
I have an action in a controller Foo that do this :

sub display : Local : Args(1) {
   ....
   my $t = $object->display_graph();
   $c->detach('Foo', 'end', [$t]);
}

sub end : Private {
   my($self, $c) = @_;
   my $g = $c->req->args()->[0];
   print $g;
}


Never use print.

use $c->res->write[2], or set $c->res->body[1].


- andreas

[1]: http://cpansearch.perl.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Response.pm#$res-%3Ebody(%3C$text |$fh|$iofh_object)
[2]: 
http://cpansearch.perl.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Response.pm#$res-%3Ewrite(_$data_)

_______________________________________________
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