Archive for the 'perl' Category

 

Borrar modulos de Perl instalados con CPAN

Jan 23, 2007 in perl

http://www.cpan.org/misc/cpan-faq.html#How_delete_Perl_modules

#!/usr/local/bin/perl -w

use ExtUtils::Packlist;
use ExtUtils::Installed;

$ARGV[0] or die “Usage: $0 Module::Name\n”;

my $mod = $ARGV[0];

my $inst = ExtUtils::Installed->new();

foreach my $item (sort($inst->files($mod))) {
print “removing $item\n”;
unlink $item;
}

my $packfile = $inst->packlist($mod)->packlist_file();
print “removing $packfile\n”;
unlink $packfile;

Instalación de módulos de perl

Jun 30, 2006 in Notas rápidas, perl

perl -MCPAN -e 'install Net::SNMP::Interfaces::Details'

alternativa

perl -MCPAN -e shell
cpan> install Net::SNMP::Interfaces::Details

Si encuentra errores:

perl -MCPAN -e shell
cpan> make Net::SNMP::Interfaces::Details

Detallará donde se encuentra el error

Ejemplo:

...
Looks good
Writing Makefile for Net::SNMP::Interfaces
Can't exec "/usr/bin/make": No existe el fichero o el directorio at /usr/share/perl/5.8/CPAN.pm line 4567.
  /usr/bin/make  -- NOT OK

Script de Perl para DBI

May 19, 2006 in perl

Esta es mi plantilla de perl para un script con DBI
Ver documentación en
http://mysql.turbolift.com/mysql/DBD_3.21.X.html