Re: [Mojolicious] Understanding shift->

2018-11-24 Thread john
On 11/24/18 2:51 PM, Dan Book wrote: The shift function removes and returns the first argument fromĀ @_ (since there's no array passed for it to shift from) in a sub. It's used this way because the first argument to these subs is the invocant/object. You can replace it with $_[0] to get the

Re: [Mojolicious] Understanding shift->

2018-11-24 Thread Dan Book
The shift function removes and returns the first argument from @_ (since there's no array passed for it to shift from) in a sub. It's used this way because the first argument to these subs is the invocant/object. You can replace it with $_[0] to get the first argument without removing it. You

[Mojolicious] Understanding shift->

2018-11-24 Thread john
This probably a perl question so if I should ask elsewhere let me know... In looking at the Mojo::Pg blog example and in recent addition of db method to Mojo::Pg::PubSub I see use of shift->. From Mojo::Pg::PubSub documentation: # Reconnect immediately