Perl::Mechanize: do i have to print to the sceen !?

good evening dear Suse-Friends,

it’s waaay too long i haven’t been coding (at all), and especially coding in perl, so please forgive me for this dumb dumb dumb question.

I haven’t found it answered, so either I can’t even properly search or it’s so dumb nobody ever dared to ask. my need : I’ve got two arrays, say

Well i am currently working on a small solution: I have tried various tutorials (examples of Mecha - that i have found on the net) not oll of them work - some of them are broken!

Now i try to get some real-world-task! This is much more interesting for me as a Perl-beginner
i start with a Mechanize-job, which sure can be done with LWP too. But at the beginning i want to keep it pretty simple. Well i need Mecha - particularly for doing the form based search and selecting the individual entries.

goal: i have approximatley 100 or more!! pages to parse
they are organized like that:


http://www.address/307.html 
http://www.address/308.html 
http://www.address/309.html

well - see the page: katholisch.at
Here at the above metioned page - you can see for more results… and there you can see what is wanted and needed.

Hmm - i guess that the algorithm would be basically only one nested loop: hmm - one outer loop runs the form based search, and yes: one inner loop processes the search results.

well i did it like this one here:

use WWW::Mechanize; 
my $mech = WWW::Mechanize->new(); 
my $url = "here the urls go in "; $mech->cookie_jar->set_cookie(0,"start",1,"/",".test.com"); $mech->get($url);

It’s really really !!! just one loop, isn’t it?


foreach my $url (@urls) { my $response = $ua->post($url, \%data);
 my $result = parse_response($response); }

well the thing is pretty simple - i need to do two things with Mechanize

  • particularly for doing the form based search and
  • selecting the individual entries and parse them

…and last but not least - the question of the day: Do i have to print the results to the screen?

well what do you say?!