[Catalyst] About output in a browser
lanas
lanas at securenet.net
Wed Aug 29 15:20:00 GMT 2007
> prints neatly, every line of the directory listing on a separate line
> in the browser:
>
> sub getFiles()
> {
> my ( $self, $c ) = @_;
> print "getFiles() !";
> @{$c->stash->{files}} = `ls -l /home/frodo/`;
> }
It looks like adding a print statement will throw the output into
literal mode of some sort. Anyhow, that's not how the output should be
made, since a view should be used and at least a minimal tt file. When
I chomp the directory lines otained with 'ls -l' and use a simple tt
file using <pre> and a view, everything is fine. But if I add a print
statement in the model's method, then even the <pre> tags are shown in
the browser.
So since I learn Catalyst and I should be using views, then this
behaviour of a print statement is not very important.
Cheers,
Al
More information about the Catalyst
mailing list