> But if I
> define the array first and then assign it to the stash, ( like 'my
> @options = qw/1 2 3 4 5 6 7/; $c->stash->{myoptions} = @options;) I am
> getting only the last value in the tt2 template. How can I get all the
> values in the array into the stash without having to do it explicitly?
That's because you're stuffing an array in a scalar. Or trying. Do this:
my @options = qw/1 2 3 4 5 6 7/;
$c->stash->{myoptions} = [EMAIL PROTECTED];
Or, for a literal translation of your first code:
my $options = [ qw/1 2 3 4 5 6 7/ ];
$c->stash->{myoptions} = $options;
Note the differences.
While you're at it, try "perldoc perlreftut" and "perldoc perlref" for
more information on references.
Good luck.
--
Mark Smith / xb95
[EMAIL PROTECTED]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/