I try the code as follows:
my @rows = getRows($sth); $self->stash(rows => \@rows);
getRows is the name of the subfunction, and the code works in the template. $ Rows is an array.
I write the code as follows:
$self->stash(rows => \getRows($sth));
$ rows is REF, this is wrong.
If you write code like this:
$self->stash(rows => getRows($sth));
$ rows is HASH, this is wrong.
Is there a way to write two string codes in one?
source share