<body>

Sitios web relacionados: PingBlog | Fotos

miércoles, enero 18, 2006

Echando código: Cuando Perl no puede (o no lo dejan): Perl + Bash



Que ladilla. Mi proveedor de ISP se empeña en no dejarme
Can't locate Date/Manip.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.6/i686-linux /usr/lib/perl5/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i686-linux /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl .) at /home/kodeg2/bin/visitor_geo_map_generator.pl
line 5.
BEGIN failed--compilation aborted at
/home/kodeg2/bin/visitor_geo_map_generator.pl line 5.
Probé usando eval {} para detectar si el modulo existía, pero por alguna estupida razón Perl compilaba todo el código y me daba un error, así que me tocó hacer un parche:

#!/bin/bash
export MONTH=`date +%b`
export YEAR=`date +%Y`
exec /usr/bin/perl -x $0 $*
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use constant LOG_FILE =>
"$ENV{HOME}/logs/kodegeek.com-" .
"$ENV{MONTH}" .
"-" .
"$ENV{YEAR}" .
".gz";
Así que que más, no me queda otra....

Buscar en Technorati: ,

2 Comentarios:

Blogger Randal L. Schwartz dijo que...

You need to install Date::Manip from the CPAN. That's not a core module.

6:20 PM (enlace permanente)  
Blogger KodeGeek dijo que...

Hello Randal,

Yeah, I know, the problem is that I don have console access on my ISP to do it; Either I beg the SAs to install an RPM for me (The server uses RedHat ES3, perl-DateManip-xxx) or they install the module using CPAN (perl -MCPAN -e'install Date::Manip'.

By the way, is that you, THE Randal Schwartz???!!!

I have several of your books and it is an honor to have you on my blog.

Anyway, thanks for the visit, hopefully I will be able to ask the SAs to get me Date::Manip installed.

Regards,

-JV.

9:25 PM (enlace permanente)  

Publicar un comentario en la entrada

Enlaces a este articulo:

Crear un vínculo

<< Regresar