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

I had few questions related to mechanize module during my previous threads. Hats off to all the monks who gave great advise.

What I want to do is have the user enter first name and last name something like
print STDOUT "\nEnter name: "; $name = <STDIN>; chomp $name;
Assuming that use enters first and last name fallowed by a space. Then I was to split it by space get the first name and last name and use the fallowing code that I have to fill the form.

My current problem is when I submit the form I don't get any results back. I am trying to figure out how do I get the results back from ancestry dot com relative to the form that I submit.

Here is the code I have

use Text::Soundex; use WWW::Mechanize; #use MakeRegex; $DEBUG = true; $SOUNDEX = 0; print STDOUT "\nEnter First name: "; $firstname = <STDIN>; chomp $firstname; print STDOUT "\nEnter Last name: "; $lastname = <STDIN>; chomp $lastname; my $url = 'http://www.ancestry.com/'; my $mechObject = WWW::Mechanize->new(); $mechObject->get($url); die "can't get page!" unless $mechObject->success && $mechObject->content =~ /Your First Name/i; die "can't find form!" unless $mechObject->form_number(2); my @values = ($firstname, $lastname, [option => 'M']); die "couldn't fill out form!" unless $mechObject->set_visible(@values) == 3; $mechObject->submit; die "can't submit form!" unless $mechObject->success && $mechObject->content =~ /Your Last Name/i;

Very Sorry, Totally forgot, as a result of above code, it spits out the html code of the first page of ancestry dot com webpage

Thanks
LearnPerl