converting Java code to Perl (using LWP?)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hello all,

I've been banging my head against the wall trying to get some code
working in Perl.  I'm assuming it will need to use the LWP module, and
I've gotten some basic things working with LWP, but not the whole

I have samples in Java, shown below.  I'm stuck at the
setRequestProperty. What's the equivalent in Perl, using LWP?

I would SO appreciate any pointers on this on.


    public TestLogin() throws IOException {
        if (Debug) System.out.println("TestLogin: Logging in...");
        /** Send the HTTPS request */
        URL url_login = new URL(Profile.Protocol+"://"+    /** i.e,
either http or https */
            Profile.Hostname+"/api/login.php"+             /** the
actual website, like  */
            "?name="+Profile.UserID+                       /** site
specific parameter  */
            "&pass="+Profile.Password+                     /** site
specific parameter  */
            "&service_type="+Profile.ServiceType);         /** site
specific parameter  */
        URLConnection urlcon_login = url_login.openConnection();
        String auth = Profile.FWUser+":"+Profile.FWPassword;
        urlcon_login.setRequestProperty("Authorization", "Basic "+
        /** Get the HTML response and parse it */
        BufferedReader inbuf_login;
        inbuf_login = new BufferedReader(
        new InputStreamReader(urlcon_login.getInputStream()));
        if (inbuf_login != null) parse(inbuf_login);
        if (Debug) System.out.println("TestLogin: Login completed
(Session ID = " + Profile.SessionID+")");

Site Timeline