WWW:Mechanize problem?
am 29.01.2007 13:00:37 von george veranisI use this script :
ï»=BF#! /usr/bin/perl
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
my $outfile =3D "out.txt";
my $url=3D"http://opac.uom.gr/ipac20/ipac.jsp?
profile=3Dbib-1--1&menu=3Daccount&ts=3D1163590369197";
my $username =3D $ARGV[0];
my $mech =3D WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
$mech->form_name('security');
$mech->field(sec1 =3D> $username);
$mech->submit_form();
my $flag;
$flag =3D $mech->content() =3D~ /Borrower ID/;
open(OUTFILE, ">$outfile");
if ($flag){
print OUTFILE "Failure";
}
else{
print OUTFILE "Success";
}
#print OUTFILE "$flag";
close(OUTFILE);
and I get the following message if i write perl -w namefile.pl
outside