Skip to content

Instantly share code, notes, and snippets.

@rbo
Created March 1, 2010 10:09
Show Gist options
  • Save rbo/318254 to your computer and use it in GitHub Desktop.
Save rbo/318254 to your computer and use it in GitHub Desktop.
sub get_proxy_credentials {
my $self = shift;
my ($user, $password);
if ( defined $CPAN::Config->{proxy_user} &&
defined $CPAN::Config->{proxy_pass}) {
$user = $CPAN::Config->{proxy_user};
$password = $CPAN::Config->{proxy_pass};
return ($user, $password);
}
my $username_prompt = "\nProxy authentication needed!
(Note: to permanently configure username and password run
o conf proxy_user your_username
o conf proxy_pass your_password
)\nUsername:";
($user, $password) =
_get_username_and_password_from_user($username_prompt);
return ($user,$password);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment