WWW:Mechanize problem?

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

Threaded View

I use this script :

=EF=BB=BF#! /usr/bin/perl
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
my $outfile = "out.txt";
my $url=3D"http://opac.uom.gr/ipac20/ipac.jsp ?
my $username = $ARGV[0];
my $mech = WWW::Mechanize->new();
$mech->field(sec1 => $username);

my $flag;
$flag = $mech->content() =~ /Borrower ID/;

open(OUTFILE, ">$outfile");

if ($flag){
    print OUTFILE "Failure";
    print OUTFILE "Success";

#print OUTFILE "$flag";

and I get the following message  if i write perl -w namefile.pl
<input> outside <form> at /home/cpanrun/parisc2.0-lp64/build/5.8.2/lib/
site_perl/5.8.2/WWW/Mechanize.pm line 1825

but if I run the same script under Windows I get the right results.

On linux server i have perl 5.8.5 and localhost in windows i have perl=20

Have somebody any idea what is the problem because I search for i over=20
a week and I can't find a solution..

Thanks in advance for a reply..

Re: WWW:Mechanize problem?

On Mon, 29 Jan 2007 04:00:37 -0800, george veranis wrote:
Quoted text here. Click to load it

Firstly, that's just a warning, so the program should otherwise behave
identically on both machines.

Secondly, inspection of sources suggests that you have an older version of
HTML::Form on the first box, when it issued that message if warnings were
enabled.  The current version requires a verbose flag to be set that
Mechanize does not enable.  Or you're not using -w when you run the
program on the Windows box.

Thirdly, the message is alerting you to the fact that the HTML has
an <INPUT> tag (probably hidden) not between <FORM> tags.  HTML::Form
won't add them as inputs to a form.  Perhaps some browsers have the
"helpful" behavior of adding them to any form submitted from that page; I
don't know, but it violates the HTML standard.  If the form action target
requires those inputs to be set you'll have to add them manually.

Peter Scott
http://www.perlmedic.com /
http://www.perldebugged.com /

Site Timeline