[Catalyst] Read and Display from i/o file

Ian Docherty catalyst at iandocherty.com
Wed Apr 11 07:08:50 GMT 2007


First you need to put the data you read into an array (for example 
@rows) then put it on the stash

The main problem is that your template

[% FOREACH row IN row %]

should be

[% FOREACH row IN rows %]

I think this is your main problem.

Ian C. Docherty (icydee)

Will Smith wrote:
> Hi,
> I am using Text::Delimited to read in a text file, that's very 
> straigth forward. My problem is I want to display back onto the 
> template what has been read from the file:
> my $row = $file->read;  # for example the file has 2 col: id, name
> I cannot do like this on the template:
> [% FOREACH row IN row %]
> [% row.id %] and [% row.name %]
> [% END %]
> Please someone give me a brief explanation why I could not do that, 
> and how can I display the data on the template.
> Thank you.

More information about the Catalyst mailing list