title: How can I authenticate when using the Bugzilla Perl API in a script?
body: <p>Working from the <a href="http://www.bugzilla.org/docs/3.2/en/html/api/Bugzilla/Auth.htm" rel="nofollow noreferrer">Bugzilla API</a>, I've written a quick Perl script to clone a Bugzilla Product (recreating all the Components under their new Product). The Bugzilla Perl API is quite easy to use from the command line. I could have just worked on the database directly, but I wanted a longer-term solution. Another option was the webservice, but I thought I'd try using the API directly this time.</p>
  
  <p>The one problem I'm running into is authenticating as my Bz admin user so I can create the new components. Looking at Bugzilla's Bugzilla.pm file, I see that they just run <code>login()</code> from a <a href="http://search.cpan.org/perldoc?Bugzilla::Auth" rel="nofollow noreferrer">Bugzilla::Auth</a> object. I'm not sure how to get the username and password in there. I suppose I could just add the script to the Bugzilla admin interface...</p>
  
  <p>Can any of you point me in the right direction?</p>