Mojolicious::Liteでパラメータを読み取る

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/usr/bin/env perl
use Mojolicious::Lite;

get '/' => sub {
    my $c = shift;
    $c->redirect_to('/foo?user=nqounet');
};

get '/foo' => sub {
    my $c = shift;
    my $user = $c->param('user');
    $c->render(text => qq{Hello $user!});
};

app->start;
1
2
#!/usr/bin/env perl
use Mojolicious::Lite;
1
2
3
4
get '/' => sub {
    my $c = shift;
    $c->redirect_to('/foo?user=nqounet');
};
1
2
3
4
5
get '/foo' => sub {
    my $c = shift;
    my $user = $c->param('user');
    $c->render(text => qq{Hello $user!});
};
1
app->start;

Comments

comments powered by Disqus