mdt has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I'm writing a script that prompts the user for his/her password at the very beginning. Having the username and password on hand for Net::SSH use works great! I'd like to use SVN::Client to svn checkout a text file. I've looked at all the sample code in the SVN::Client perldocs and done a good deal of web searching, but haven't been able to find a way to simply pass SVN::Client->new() the username/password that I've already tucked away in a couple variables ($user/$pass). Might some wise perl monk already have tackled this problem? Thanks in advance! Marshall
  • Comment on SVN::Client - Passing it a Username and Password

Replies are listed 'Best First'.
Re: SVN::Client - Passing it a Username and Password
by Anonymous Monk on Apr 16, 2011 at 02:14 UTC
    The SVN::Client documentation lists So you might write
    use SVN::Client; my $ctx = new SVN::Client( auth => [ SVN::Client::get_simple_provider(), SVN::Client::get_simple_prompt_provider( sub { my $cred = shift; $cred->username($user); $cred->password($pass); }, 2 ), SVN::Client::get_username_provider() ] );