Mark Funk wrote:
> Folks,
>
> I wrote some Perl scripts that connects to an HTTP server and determines the
> availability of a web page..
> This has been working fine for about six months. All of the sudden the script
> stopped working and I made NO change.
>
> Script snippet:
...
> @step1 = $ua->request($req)->as_string;
Try a scalar here:
$step1 = $ua->request($req)->as_string;
> if ($step1[0] =~ /<form name=\"LoginForm\"/) {
Try:
if ($step1 =~ /<form name=\"LoginForm\"/s) { # note the /s
> Any thoughts?
Not sure any of the above will help, but a similar page of mine works with :
my $ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file => 'lwpcookies.txt', autosave => 1));
print "Checking $url\n";
my $req = HTTP::Request->new(GET => $url);
$req->authorization_basic($pnuname, $pnpass);
my $ct1 = $ua->request($req)->as_string;
print "Step1 content: $ct1\n\n";
# if auth fails I get the Illegal Page Access
if ($ct1 =~ /Illegal Page Access/s) { # Note the /s qualifier
print "Failed\n";
} else {
print "Success\n";
}
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs