in reply to LWP::UserAgent proxy
As per the docs:
$ua->get_basic_credentials( $realm, $uri, $isproxy )
This is called by request() to retrieve credentials for documents protected by Basic or Digest Authentication. The arguments passed in is the $realm provided by the server, the $uri requested and a boolean flag to indicate if this is authentication against a proxy server.
The method should return a username and password. It should return an empty list to abort the authentication resolution attempt. Subclasses can override this method to prompt the user for the information. An example of this can be found in lwp-request program distributed with this library.
The base implementation simply checks a set of pre-stored member variables, set up with the credentials() method.
To answer your question, $username is $user and $password is $pass. Extending the class simply allows the caller to store login credentials for the object