1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
use Mojolicious::Lite;
use Text::LTSV;
get '/' => sub {
my $self = shift;
my $p = Text::LTSV->new;
my $datafile = 'hoge.ltsv';
my $data = $p->parse_file($datafile) or die;
$self->stash(data => $data);
$self->render('index');
};
app->start;
__DATA__
@@ index.html.ep
% for my $line (@{$data}) {
<a href="<%= $line->{url} %>"><%= $line->{url} %></a>
% }
|