People who just stumbled upon this thread might be interested to know that 
*ua* is available as a default helper since Mojolicious 4.13 
<https://github.com/kraih/mojo/commit/28aa59de2f738ed9b2820e62abf52a0baa41842b>
.

https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers

On Thursday, January 3, 2013 11:06:07 PM UTC+5:30, Chuck wrote:
>
> Awesome! Thank you very much!
> On Jan 3, 2013 12:32 PM, "sri" <[email protected] <javascript:>> 
> wrote:
>
>> > how can I do the requests with a new ua without it going out of scope?
>>
>> There are many ways, here are two.
>>
>>     helper my_ua => sub { state $ua = Mojo::UserAgent->new };
>>
>> or
>>
>>     my $ua = $self->stash->{ua} = Mojo::UserAgent->new;
>>
>> --
>> sebastian
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> For more options, visit this group at 
>> http://groups.google.com/group/mojolicious?hl=en.
>>
>>  

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to