<div dir="ltr">@Nelson, concordo que com o Mojo faz essa e mais tarefas de modo trivial, mas você garante que o código continuará funcionando com as atualizações do Framework? Ou a cada atualização do Framework, caso eu queira usar as novas features, preciso cruzar os dedos para que tudo continue funcionando? </div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/23 Nelson Ferraz <span dir="ltr"><<a href="mailto:nferraz@gmail.com" target="_blank">nferraz@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Tudo isso pra setar um cookie? <div><br></div><div>Sem querer iniciar uma flamewar, mas com o Mojolicious::Lite e' bem simples:<div><br></div><div>#####</div><div><br></div><div>use Mojolicious::Lite;</div>

<div><br></div><div><div>get '/login' => sub {<br></div><div>    my $self = shift;</div><div><br></div><div>    # Query parameters</div><div>    my $user = $self->param('user') || '';</div><div>

    my $pass = $self->param('pass') || '';</div><div><br></div><div><div>    # Store username in session</div><div>    $self->session(user => $user);</div></div><div><br></div><div>} => 'index';</div>

</div><div><br></div><div>app->start();<br></div><div><br></div><div>#####</div></div><div><br></div><div>Isso e' tudo!</div><div><br></div><div>Se voce estiver em duvida, assista aos tutoriais do Mojocast:</div><div>

<br></div><div><a href="http://mojocasts.com/" target="_blank">http://mojocasts.com/</a><br></div><div><br></div><div>Em menos de 30 minutos voce podera' decidir se vale a pena mudar para um framework que (na minha opiniao) te ajudara' a poupar dias de trabalho e frustracao.</div>

<div><br></div><div>Repito: meu objetivo nao e' iniciar um flamewar, mas apenas ajuda'-lo a tomar uma decisao bem informada.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">
2013/7/22 Daniel de Oliveira Mantovani <span dir="ltr"><<a href="mailto:daniel.oliveira.mantovani@gmail.com" target="_blank">daniel.oliveira.mantovani@gmail.com</a>></span><br>
</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>package Admin;<br>
use Moose;<br>
use namespace::autoclean;<br>
<br>
use Catalyst::Runtime 5.80;<br>
<br>
# Set flags and add plugins for the application.<br>
#<br>
# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,<br>
# therefore you almost certainly want to keep ConfigLoader at the head of the<br>
# list if you're using it.<br>
#<br>
#         -Debug: activates the debug mode for very useful log messages<br>
#   ConfigLoader: will load the configuration from a Config::General file in the<br>
#                 application's home directory<br>
# Static::Simple: will serve static files from the application's root<br>
#                 directory<br>
<br>
use Catalyst qw/<br>
    -Debug<br>
    ConfigLoader<br>
    Static::Simple<br>
/;<br>
<br>
extends 'Catalyst';<br>
</div>with 'CatalystX::AuthenCookie';<br>
<div><div><br>
our $VERSION = '0.01';<br>
<br>
# Configure the application.<br>
#<br>
# Note that settings in admin.conf (or other external<br>
# configuration file that you set up manually) take precedence<br>
# over this when using ConfigLoader. Thus configuration<br>
# details given here can function as a default configuration,<br>
# with an external configuration file acting as an override for<br>
# local deployment.<br>
<br>
__PACKAGE__->config(<br>
    name => 'Admin',<br>
    # Disable deprecated behavior needed by old applications<br>
    disable_component_resolution_r<br>
egex_fallback => 1,<br>
    enable_catalyst_header => 1, # Send X-Catalyst header<br>
);<br>
<br>
# Start the application<br>
__PACKAGE__->setup();<br>
=encoding utf8<br>
<br>
=head1 NAME<br>
<br>
Admin - Catalyst based application<br>
<br>
=head1 SYNOPSIS<br>
<br>
    script/<a href="http://admin_server.pl" target="_blank">admin_server.pl</a><br>
<br>
=head1 DESCRIPTION<br>
<br>
[enter your description here]<br>
<br>
=head1 SEE ALSO<br>
<br>
L<Admin::Controller::Root>, L<Catalyst><br>
<br>
=head1 AUTHOR<br>
<br>
Ricardo,,,<br>
<br>
=head1 LICENSE<br>
<br>
This library is free software. You can redistribute it and/or modify<br>
it under the same terms as Perl itself.<br>
<br>
=cut<br>
<br>
1;<br>
<br>
</div></div><div><div>On 22 July 2013 14:47, Renato Santos <<a href="mailto:renato.cron@gmail.com" target="_blank">renato.cron@gmail.com</a>> wrote:<br>
> No caso, eu não tinha reparado.<br>
><br>
> o modulo não precisa ir no qw//.<br>
><br>
> Coloque o "with 'CatalystX::AuthenCookie';" depois do use Catalyst qw/ ...<br>
> /. assim o moose vai importar¹ as funções desse CatalystX junto com o object<br>
> do Catalyst.<br>
><br>
><br>
> ¹<br>
> <a href="http://search.cpan.org/dist/Moose/lib/Moose/Manual/Roles.pod#WHAT_IS_A_ROLE" target="_blank">http://search.cpan.org/dist/Moose/lib/Moose/Manual/Roles.pod#WHAT_IS_A_ROLE</a>?<br>
><br>
><br>
> On Mon, Jul 22, 2013 at 2:43 PM, Ricardo Alcantara<br>
> <<a href="mailto:alcantarafox@yahoo.com.br" target="_blank">alcantarafox@yahoo.com.br</a>> wrote:<br>
>><br>
>> Seria isso?<br>
>><br>
>> package Admin;<br>
>> use Moose;<br>
>> use namespace::autoclean;<br>
>><br>
>> use Catalyst::Runtime 5.80;<br>
>><br>
>> # Set flags and add plugins for the application.<br>
>> #<br>
>> # Note that ORDERING IS IMPORTANT here as plugins are initialized in<br>
>> order,<br>
>> # therefore you almost certainly want to keep ConfigLoader at the head of<br>
>> the<br>
>> # list if you're using it.<br>
>> #<br>
>> #         -Debug: activates the debug mode for very useful log messages<br>
>> #   ConfigLoader: will load the configuration from a Config::General file<br>
>> in the<br>
>> #                 application's home directory<br>
>> # Static::Simple: will serve static files from the application's root<br>
>> #                 directory<br>
>><br>
>> use Catalyst qw/<br>
>>     -Debug<br>
>>     ConfigLoader<br>
>>     Static::Simple<br>
>> /;<br>
>><br>
>> extends 'Catalyst';<br>
>><br>
>> our $VERSION = '0.01';<br>
>><br>
>> # Configure the application.<br>
>> #<br>
>> # Note that settings in admin.conf (or other external<br>
>> # configuration file that you set up manually) take precedence<br>
>> # over this when using ConfigLoader. Thus configuration<br>
>> # details given here can function as a default configuration,<br>
>> # with an external configuration file acting as an override for<br>
>> # local deployment.<br>
>><br>
>> __PACKAGE__->config(<br>
>>     name => 'Admin',<br>
>>     # Disable deprecated behavior needed by old applications<br>
>>     disable_component_resolution_regex_fallback => 1,<br>
>>     enable_catalyst_header => 1, # Send X-Catalyst header<br>
>> );<br>
>><br>
>> # Start the application<br>
>> __PACKAGE__->setup();<br>
>> =encoding utf8<br>
>><br>
>> =head1 NAME<br>
>><br>
>> Admin - Catalyst based application<br>
>><br>
>> =head1 SYNOPSIS<br>
>><br>
>>     script/<a href="http://admin_server.pl" target="_blank">admin_server.pl</a><br>
>><br>
>> =head1 DESCRIPTION<br>
>><br>
>> [enter your description here]<br>
>><br>
>> =head1 SEE ALSO<br>
>><br>
>> L<Admin::Controller::Root>, L<Catalyst><br>
>><br>
>> =head1 AUTHOR<br>
>><br>
>> Ricardo,,,<br>
>><br>
>> =head1 LICENSE<br>
>><br>
>> This library is free software. You can redistribute it and/or modify<br>
>> it under the same terms as Perl itself.<br>
>><br>
>> =cut<br>
>><br>
>> 1;<br>
>><br>
>><br>
>> =begin disclaimer<br>
>>   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
>> SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
>> L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
>> =end disclaimer<br>
><br>
><br>
><br>
><br>
> --<br>
> Saravá,<br>
> Renato CRON<br>
> <a href="http://www.renatocron.com/blog/" target="_blank">http://www.renatocron.com/blog/</a><br>
> @renato_cron<br>
><br>
> =begin disclaimer<br>
>    Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
>  SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
>  L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
> =end disclaimer<br>
><br>
<br>
<br>
<br>
--<br>
<br>
</div></div><div>-dom<br>
<br>
--<br>
<br>
IBM - Business Analytics Optimization Consultant<br>
Daniel Mantovani <a href="tel:%2B5511%208538-9897" value="+551185389897" target="_blank">+5511 8538-9897</a><br>
XOXO<br>
</div><div><div>=begin disclaimer<br>
   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
 SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
 L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
=end disclaimer<br>
</div></div></blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Nelson Ferraz
</font></span></div>
<br>=begin disclaimer<br>
   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
 SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
 L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
=end disclaimer<br>
<br></blockquote></div><br></div>