mod_perl isn't a language, it is an application server.

If the question is "Is it mod_perl safe?", then that is a different
question.  I would think they are, both are OOP, and there is no state that
I am aware of that is outside of the object properties.

Rob

-----Original Message-----
From: rkl [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 3:40 AM
To: perl
Subject: Re: WWW::Mechanize and Cookies


Hi all: 

Are these libs: WWW:: Mechanize and HTTP::Cookies in perl or mod_perl? 

 -rkl 

Pablo Fischer writes: 

> Hi! 
> 
> Im creating an script that checks for broken links. Im using this modules:

> 
> use WWW::Mechanize;
> use HTTP::Cookies; 
> 
> What Im trying to do?, I need to login in a website (cause to check broken

> links I need to be loged).  
> 
> I also checked the cookies once I've loged and they're created, however,
when 
> I try to entrer another website I cant cause the website shows me a pretty

> message: "Not Authorized". 
> 
> My Code:
> ____________________
> #El archivo en el que se guardan las cookies
> $cookies = "/home/unmada/cookies.txt"; 
> 
> #El objeto que va a estar escuchando las cookies
> $cookie = HTTP::Cookies->new(
>                            file => $cookies,
>                            ignore_discard => 1,
>                            autosave => 1);
> #$agent->cookie_jar($cookie); 
> 
> #El objeto que va a hacerla de navegador
> my $agent = WWW::Mechanize->new(agent => 'Mozilla/5.0',
>                               debug => 1);
> #La dirección que se va a visitar (la primera)
> my $url = "http://cursos.itesm.mx/webapps/login";; 
> 
> #$agent->redirect_ok();
> #Decirle al navegador que las cookies van a ser guardadas en el objeto
cookie
> $agent->cookie_jar($cookie); 
> 
> #Cargamos la página
> $agent->get($url);
> #Mostramos el titulo de la página
> print $agent->title(),"\n";
> #Buscamos el formulario que tiene el nombre de 'login'
> $agent->form("login");
> #Llenamos el campo de user_id
> $agent->field("user_id", "username");
> #Llenamos el campo de password
> $agent->field("password", "password");
> #Le damos ENTER
> $agent->submit(); 
> 
> Then to enter another website (in the same domain), I jsut: 
> 
> $agent->get("otherurl_of_the_same_domain");
> ____ 
> 
> Thanks!
> Pablo
> -- 
> Pablo Fischer Sandoval ([EMAIL PROTECTED])
> http://www.pablo.com.mx
> http://www.debianmexico.org
> GPG FingerTip: 3D49 4CB8 8951 F2CA 8131  AF7C D1B9 1FB9 6B11 810C
> Firma URL: http://www.pablo.com.mx/firmagpg.txt 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to