in reply to Subs calling themselves

> these two subroutines just seem to be calling each other

The access_token subroutine isn't calling any subroutine. It just accesses the hash referenced by $self and returns the value associated with the access_token key, i.e. it's a standard getter method.

What does request do with the value? It calls the method request on it. It seems confusing, but the access token is probably of a different class than $self, so it's calling a different request method.

Update: Indeed, see LWP::Authen::OAuth2::AccessToken.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Subs calling themselves
by Bod (Parson) on May 07, 2021 at 21:41 UTC

    Thank you choroba - it was the two different methods having the same name that was throwing me!

    Now to work out why $self->access_token is undefined...