Created
October 29, 2013 16:38
-
-
Save MadMartigan/7218147 to your computer and use it in GitHub Desktop.
How to loop through an arrayref returned from a helper directly in a template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the helper | |
$app->helper( | |
testarray => sub { | |
my $self = shift; | |
my @array = ("Quarter","Dime","Nickel"); | |
return \@array; | |
} | |
); | |
%# in the template | |
% my $arrayref = testarray; | |
% for (@$arrayref) { | |
<%= $_ %> <br> | |
% } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment