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

I am trying to login to a test box using the following, I would like to print out the page, but its not working.
use LWP; use LWP::Simple; my $browser = LWP::UserAgent->new( ); my $url="http://qasef43.mlxchange.com"; $browser->agent("Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt +)"); $browser->credentials('http://qasef43.mlxchange.com:80',username,passw +ord); my $response = $browser->get($url); my $data=$response->content(); print "$data";
I got it to work, now I have another problem, I need to have my browser support activex controls for testing the web application is there any way to do this using lwp?

Replies are listed 'Best First'.
Re: trying to test login via lwp
by ysth (Canon) on Feb 26, 2008 at 23:37 UTC
    '$username', '$password'
    Variables are not interpolated in single quoted strings, so you are literally using the username '$' followed by 'username'.

    Use double quoted strings when you want to interpolate variables, but in this case there's no need for a string at all. Just pass $username, $password.

Re: trying to test login via lwp
by Fletch (Bishop) on Feb 26, 2008 at 23:01 UTC

    Printing a brand new HTTP::Request instance that you just created the line before isn't likely to do much of use as far as actually retrieving anything. Maybe try reading some documentation rather than just tossing crap together randomly and wondering why it's not working?

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.