[Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Edward Baudrez
Hello list There is this hint in the FAQ about keeping a strong reference to the transaction object $tx around, so that the message "Transaction already destroyed" does not appear in the logs: https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Transaction-already-destroyed-mean Howe

Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Felipe Gasper
I think you could do: $tx = $tx; … instead. (It might be worth updating the FAQ to do that?) -F > On Nov 16, 2020, at 8:08 AM, Edward Baudrez wrote: > > Hello list > > There is this hint in the FAQ about keeping a strong reference to the > transaction object $tx around, so that the

Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Dan Book
A common idiom is `undef $tx;` since you are also done with the object at that point. -Dan On Mon, Nov 16, 2020 at 8:41 AM Felipe Gasper wrote: > I think you could do: > > $tx = $tx; > > … instead. (It might be worth updating the FAQ to do that?) > > -F > > > On Nov 16, 2020, at 8:08 AM

Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Dan Book
That is, after the ->reply->exception. -Dan On Mon, Nov 16, 2020 at 12:18 PM Dan Book wrote: > A common idiom is `undef $tx;` since you are also done with the object at > that point. > > -Dan > > On Mon, Nov 16, 2020 at 8:41 AM Felipe Gasper > wrote: > >> I think you could do: >> >> $t