<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title># rm-rf.es &#187; perl</title>
	<atom:link href="http://rm-rf.es/sobre/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://rm-rf.es</link>
	<description>Administración de sistemas, Unix, Linux, FreeBSD, Windows, hosting, dominios, servidores...</description>
	<lastBuildDate>Wed, 23 May 2012 19:38:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>DB_File.xs:101: db.h: No such file or directory</title>
		<link>http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/</link>
		<comments>http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 19:27:20 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[compilador]]></category>
		<category><![CDATA[perl module]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=2420</guid>
		<description><![CDATA[La situación es la siguiente. Estamos compilando en Solaris 10 el módulo de Perl DB_File. El requerimiento lógico es tener instalado BerkeleyDB en el servidor así que procedemos a ello: # pkgadd -d db-4.7.25.NC-sol10-x86-local Ahora procedemos a la típica compilación (Elegir el compilador correcto para Perl en Solaris) y nos encontramos con uno de estos [...]]]></description>
			<content:encoded><![CDATA[<p>La situación es la siguiente. Estamos <strong>compilando en Solaris 10 el módulo de Perl DB_File</strong>. El requerimiento lógico es tener instalado <strong>BerkeleyDB</strong> en el servidor así que procedemos a ello:</p>
<pre># pkgadd -d db-4.7.25.NC-sol10-x86-local</pre>
<p>Ahora procedemos a la típica compilación (<a title="Elegir el compilador correcto para Perl en Solaris" href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/">Elegir el compilador correcto para Perl en Solaris</a>) y nos encontramos con uno de estos dos errores:</p>
<pre>  cc -c -I/usr/local/include -Dbool=char -DHAS_BOOL
  -O2    -DVERSION=\"1.64\" -DXS_VERSION=\"1.64\" -fpic
  -I/usr/local/lib/perl5/i586-linux/5.00404/CORE -DmDB_Prefix_t=size_t
  -DmDB_Hash_t=u_int32_t DB_File.c
  DB_File.xs:101: db.h: No such file or directory</pre>
<pre>  LD_RUN_PATH="/lib" cc -o blib/arch/auto/DB_File/DB_File.so  -shared
  -L/usr/local/lib DB_File.o    -L/usr/local/lib -ldb
  ld: cannot open -ldb: No such file or directory</pre>
<p>Es raro porque el fichero db.h se encuentra en la ruta de instalación de DB. El problema es que <strong>el fichero de configuración para la compilación del módulo presupone una ruta estándar</strong> que en este caso no se cumple. Así que modificamos dicho fichero de esta forma:</p>
<p>Antes (<strong>config.in</strong>):</p>
<pre>	INCLUDE = /usr/local/BerkeleyDB/include
	LIB     = /usr/local/BerkeleyDB/lib</pre>
<p>Por la ruta donde se encuentre, en mi caso /usr/local/BerkeleyDB.4.7/include/db.h:</p>
<pre>	INCLUDE = /usr/local/BerkeleyDB.4.7/include
	LIB     = /usr/local/BerkeleyDB.4.7/lib</pre>
<p>Y a compilar.</p>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li><li><a href="http://rm-rf.es/bucle-de-password-expirado-en-ldap-nativo-rhel-contra-sun-ldap/" title="Bucle de password expirado en ldap nativo RHEL contra Sun LDAP">Bucle de password expirado en ldap nativo RHEL contra Sun LDAP</a></li><li><a href="http://rm-rf.es/consultar-y-exportar-certificados-ssl-en-sun-web-server-certutil-y-pkcs12/" title="Consultar y exportar certificados SSL en Sun Web Server (certutil y pkcs12)">Consultar y exportar certificados SSL en Sun Web Server (certutil y pkcs12)</a></li><li><a href="http://rm-rf.es/debug-de-procesos-en-solaris-con-truss/" title="Debug de procesos en Solaris con Truss">Debug de procesos en Solaris con Truss</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegir el compilador correcto para Perl en Solaris</title>
		<link>http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/</link>
		<comments>http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 18:32:35 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[compilador]]></category>
		<category><![CDATA[perl module]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=2416</guid>
		<description><![CDATA[Cuando compilamos módulos de Perl en Solaris (en este caso Solaris 10) hay que tener muy claro el compilador a utilizar. En esta versión de Solaris tenemos por defecto la versión 5.8.4 de Perl, la cual ha sido compilada con la suite de compilación de Sun Studio. La forma habitual de compilar módulos es la [...]]]></description>
			<content:encoded><![CDATA[<p>Cuando <strong>compilamos módulos de Perl en Solaris</strong> (en este caso Solaris 10) hay que tener muy claro el compilador a utilizar. En esta versión de Solaris tenemos por defecto la versión 5.8.4 de Perl, la cual ha sido compilada con la <strong>suite de compilación de Sun Studio</strong>. La forma habitual de compilar módulos es la siguiente:</p>
<pre># perl Makefile.PL
# make
# make test
# make install</pre>
<p>Si lo hacemos así, el sistema utilizará el compilador Sun Studio y habrá flags incompatibles, errores de compilación, etc. Lo que tenemos que hacer es <strong>forzar la utilización del compilador GNU C/C++</strong>, que por defecto lo encontraremos en <strong>/usr/sfw/bin</strong> como nos indica el <a href="http://twiki.org/cgi-bin/view/Codev/SolarisInstallCookbookPerlModules" target="_blank">Solaris Install CookBook</a>.</p>
<p>Lo primero que tenemos que hacer es añadir esta ruta al PATH ya que por defecto no está:</p>
<pre>export PATH=$PATH:/usr/sfw/bin</pre>
<p>Para la ejecución del Makefile.PL utilizaremos perlgcc en lugar de perl a secas, está en la ruta &#8220;<strong>/usr/perl5/bin/perlgcc</strong>&#8220;. Para los make forzaremos la utilización de gmake en la ruta anteriormente citada. La lista de comandos sería la siguiente:</p>
<pre># /usr/perl5/bin/perlgcc Makefile.PL
# /usr/sfw/bin/gmake MAKE=/usr/sfw/bin/gmake
# /usr/sfw/bin/gmake MAKE=/usr/sfw/bin/gmake test
# /usr/sfw/bin/gmake MAKE=/usr/sfw/bin/gmake install</pre>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/bucle-de-password-expirado-en-ldap-nativo-rhel-contra-sun-ldap/" title="Bucle de password expirado en ldap nativo RHEL contra Sun LDAP">Bucle de password expirado en ldap nativo RHEL contra Sun LDAP</a></li><li><a href="http://rm-rf.es/consultar-y-exportar-certificados-ssl-en-sun-web-server-certutil-y-pkcs12/" title="Consultar y exportar certificados SSL en Sun Web Server (certutil y pkcs12)">Consultar y exportar certificados SSL en Sun Web Server (certutil y pkcs12)</a></li><li><a href="http://rm-rf.es/debug-de-procesos-en-solaris-con-truss/" title="Debug de procesos en Solaris con Truss">Debug de procesos en Solaris con Truss</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel 11.25: error en módulo perl Mail::SPF</title>
		<link>http://rm-rf.es/cpanel-11-25-error-en-modulo-perl-mailspf/</link>
		<comments>http://rm-rf.es/cpanel-11-25-error-en-modulo-perl-mailspf/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 09:20:55 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=1209</guid>
		<description><![CDATA[Al parecer en algunas versiones del nuevo cPanel 11.25.0-RELEASE se están detectando errores en la instalación del módulo de perl Mail::SPF. Si ejecutamos /scripts/checkperlmodules encontramos los siguientes errores: CPAN.pm: Going to build J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.007.tar.gz perl-64bit-hack: enabled # running Build.PL --otherldflags -L/usr/lib64 --config ldflags=-L/usr/lib64 --extralibdir /usr/lib64 Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for [...]]]></description>
			<content:encoded><![CDATA[<p>Al parecer en algunas versiones del nuevo <strong>cPanel 11.25.0-RELEASE</strong> se están detectando errores en la instalación del módulo de <strong>perl Mail::SPF</strong>. Si ejecutamos /scripts/checkperlmodules encontramos los siguientes errores:</p>
<pre>
CPAN.pm: Going to build J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.007.tar.gz

perl-64bit-hack: enabled
# running Build.PL --otherldflags -L/usr/lib64 --config ldflags=-L/usr/lib64 --extralibdir /usr/lib64
Creating new 'MYMETA.yml' with configuration results
Creating new 'Build' script for 'Mail-SPF' version 'v2.7.0'
Prereq 'v5.6' for 'perl' is not supported by Module::Build::Compat
make: *** No targets.  Stop.
 JMEHNLE/mail-spf/Mail-SPF-v2.007.tar.gz
 /usr/bin/make OTHERLDFLAGS=-L/usr/lib64 LDFLAGS=-L/usr/lib64 EXTRALIBDIR=/usr/lib64 OTHERLDFLAGS=-L/usr/lib64 LDFLAGS=-L/usr/lib64 EXTRALIBDIR=/usr/lib64 -- NOT OK
Running make install
 Make had returned bad status, install seems impossible
perlmod--Install done
</pre>
<p>Para efectuar la instalación de un modo correcto ejecutad el siguiente comando:</p>
<pre> perl -MCPAN -e "get('Mail::SPF')" &#038;&#038; cd /home/.cpan/sources/authors/id/J/JM/JMEHNLE/mail-spf &#038;&#038; tar -xzvf Mail-SPF-v2.007.tar.gz &#038;&#038; cd Mail-SPF-v2.007 &#038;&#038; perl Build.PL &#038;&#038; ./Build &#038;&#038; ./Build test &#038;&#038; ./Build install &#038;&#038; /scripts/checkperlmodules --full</pre>
<p>Fuente | <a target="_blank" href="http://forums.cpanel.net/f43/mail-spf-fails-install-142285.html">Foros cPanel</a></p>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/cpanel-internal-server-error-user-is-over-quota/" title="cPanel: Internal Server Error User is over quota">cPanel: Internal Server Error User is over quota</a></li><li><a href="http://rm-rf.es/cpanel-roundcube-service-currently-not-available-error-no-0x01f4/" title="cPanel: Roundcube SERVICE CURRENTLY NOT AVAILABLE! Error No. [0x01F4]">cPanel: Roundcube SERVICE CURRENTLY NOT AVAILABLE! Error No. [0x01F4]</a></li><li><a href="http://rm-rf.es/cpanel-backup-the-backup-of-account-encountered-errors-on/" title="cPanel Backup: The backup of <user> account encountered errors on &#8230;">cPanel Backup: The backup of <user> account encountered errors on &#8230;</a></li><li><a href="http://rm-rf.es/dbd-driver-has-not-implemented-the-autocommit-attribute-at-usrlocallibperl5site_perl588machdbipm/" title="DBD driver has not implemented the AutoCommit attribute at /usr/local/lib/perl5/site_perl/5.8.8/mach/DBI.pm">DBD driver has not implemented the AutoCommit attribute at /usr/local/lib/perl5/site_perl/5.8.8/mach/DBI.pm</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/cpanel-11-25-error-en-modulo-perl-mailspf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actualizar todos los módulos de Perl desde CPAN</title>
		<link>http://rm-rf.es/actualizar-modulos-perl-cpan/</link>
		<comments>http://rm-rf.es/actualizar-modulos-perl-cpan/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 18:02:45 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[actualizar]]></category>
		<category><![CDATA[cpan]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=1205</guid>
		<description><![CDATA[Gracias a CPAN, existe una forma muy sencilla y cómoda de actualizar de vez todos los módulos de PERL que tengamos instalados en el sistema, para ello, simplemente ejecutad lo siguiente: cpan -r Automáticamente comenzará la actualización de los módulos: $ cpan -r CPAN: Storable loaded ok Going to read /home/alex/.cpan/Metadata Database was generated on [...]]]></description>
			<content:encoded><![CDATA[<p>Gracias a <strong><a title="Instalación módulos de Perl con CPAN" target="_blank" href="http://rm-rf.es/como-instalar-modulos-de-perl-via-cpan/">CPAN</a></strong>, existe una forma muy sencilla y cómoda de actualizar de vez todos los módulos de <strong><a target="_blank" title="PERL"  href="http://rm-rf.es/sobre/perl/">PERL</a></strong> que tengamos instalados en el sistema, para ello, simplemente ejecutad lo siguiente:</p>
<pre>cpan -r</pre>
<p>Automáticamente comenzará la actualización de los módulos:</p>
<pre>$ cpan -r
CPAN: Storable loaded ok
Going to read /home/alex/.cpan/Metadata
  Database was generated on Mon, 10 Aug 2009 23:26:58 GMT
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
Going to read /home/alex/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
LWP failed with code[500] message[LWP::Protocol::MyFTP: connect: Conexi�n rechazada]
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
Going to read /home/alex/.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Fri, 18 Dec 2009 01:45:07 GMT

Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz

Going to read /home/alex/.cpan/sources/modules/03modlist.data.gz
Going to write /home/alex/.cpan/Metadata
...................... etc etc
</pre>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/como-instalar-modulos-de-perl-via-cpan/" title="Cómo instalar módulos de Perl vía CPAN">Cómo instalar módulos de Perl vía CPAN</a></li><li><a href="http://rm-rf.es/postfix-mailscanner-you-must-upgrade-your-perl-io-module-to-at-least/" title="Postfix + MailScanner: You must upgrade your perl IO module to at least&#8230;">Postfix + MailScanner: You must upgrade your perl IO module to at least&#8230;</a></li><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/actualizar-modulos-perl-cpan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl: Enviar correos con el módulo MIME::Lite</title>
		<link>http://rm-rf.es/perl-enviar-correos-modulo-mimelite/</link>
		<comments>http://rm-rf.es/perl-enviar-correos-modulo-mimelite/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:16:12 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[correo]]></category>
		<category><![CDATA[mime::lite]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=1032</guid>
		<description><![CDATA[Hoy vamos a ver un ejemplo sencillo de programación en Perl, mediante el cual vamos a enviar un correo electrónico. Utilizamos el módulo MIME::Lite, que permite mandar contenido html (u otro MIME) en el cuerpo del mensaje. El ejemplo que os voy a mostrar envía el correo utilizando el método de envío por defecto que [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy vamos a ver un ejemplo sencillo de programación en Perl, mediante el cual vamos a enviar un correo electrónico. Utilizamos el módulo <strong>MIME::Lite</strong>, que permite mandar contenido html (u otro MIME) en el cuerpo del mensaje.</p>
<p>El ejemplo que os voy a mostrar envía el correo utilizando el método de envío por defecto que tenga el sistema en el que se ejecuta (si es Linux, normalmente sendmail). Ahí va:</p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span><br />
<span style="color: #000000; font-weight: bold;">use</span> MIME<span style="color: #339933;">::</span><span style="color: #006600;">Lite</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Asunto del correo&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$from</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;test<span style="color: #000099; font-weight: bold;">\@</span>dominio.com&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$to</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;destinatario<span style="color: #000099; font-weight: bold;">\@</span>dominio.com&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$body</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Esto es el cuerpo del correo ...&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$msg</span> <span style="color: #339933;">=</span> MIME<span style="color: #339933;">::</span><span style="color: #006600;">Lite</span><span style="color: #339933;">-&gt;</span><span style="color: #000000; font-weight: bold;">new</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Subject <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$subject</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; From &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$from</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; To &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$to</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Type &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'text/html'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Data &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>&nbsp; <br />
<span style="color: #0000ff;">$msg</span><span style="color: #339933;">-&gt;</span><a href="http://perldoc.perl.org/functions/send.html"><span style="color: #000066;">send</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Básicamente declaramos las variables que contienen el asunto, destinatarios, cuerpo del mensaje, etc y abrimos la clase para trabajar con ella, finalmente enviamos el correo.</p>
<p>En la propia página de cpan hay bastantes ejemplos y muy útiles, os dejo un par de ellos, <a href="http://search.cpan.org/dist/MIME-Lite/lib/MIME/Lite.pm#field_order">podéis ver los demás aquí</a>.</p>
<p>Agregar una imagen a un mensaje con varios destinatarios:</p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">### Start with a simple text message:</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$msg</span> <span style="color: #339933;">=</span> MIME<span style="color: #339933;">::</span><span style="color: #006600;">Lite</span><span style="color: #339933;">-&gt;</span><span style="color: #000000; font-weight: bold;">new</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; From &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'me@myhost.com'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; To &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'you@yourhost.com'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Cc &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'some@other.com, some@more.com'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Subject <span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'A message with 2 parts...'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Type &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'TEXT'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Data &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">&quot;Here's the GIF file you wanted&quot;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">### Attach a part... the make the message a multipart automatically:</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$msg</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">attach</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Type &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'image/gif'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Path &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'aaa000123.gif'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Filename <span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">'logo.gif'</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Utilizar otro método de envío de correo si no tenemos sendmail:</p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">### Do something like this in your 'main':</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$I_DONT_HAVE_SENDMAIL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;MIME<span style="color: #339933;">::</span><span style="color: #006600;">Lite</span><span style="color: #339933;">-&gt;</span><a href="http://perldoc.perl.org/functions/send.html"><span style="color: #000066;">send</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'smtp'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$host</span><span style="color: #339933;">,</span> Timeout<span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">60</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUser<span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">$user</span><span style="color: #339933;">,</span> AuthPass<span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">### Now this will do the right thing:</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$msg</span><span style="color: #339933;">-&gt;</span><a href="http://perldoc.perl.org/functions/send.html"><span style="color: #000066;">send</span></a><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">### will now use Net::SMTP as shown above</span></div></div>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/consultar-imap-o-pop-desde-shell-con-mutt/" title="Consultar IMAP o POP desde shell con mutt">Consultar IMAP o POP desde shell con mutt</a></li><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li><li><a href="http://rm-rf.es/exim-establecer-filtros-anti-spam-para-entrada-y-salida-de-correo/" title="Exim: establecer filtros anti-spam para entrada y salida de correo">Exim: establecer filtros anti-spam para entrada y salida de correo</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/perl-enviar-correos-modulo-mimelite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl: Encriptar y desencriptar base64 con MIME::Base64</title>
		<link>http://rm-rf.es/perl-encriptar-desencriptar-base64-mimebase64/</link>
		<comments>http://rm-rf.es/perl-encriptar-desencriptar-base64-mimebase64/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 07:37:47 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[desencriptar]]></category>
		<category><![CDATA[encriptar]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=1001</guid>
		<description><![CDATA[El módulo de Perl MIME::Base64 proporciona funciones para codificar y descodificar cadenas en y desde base64. Base 64 es un sistema de numeración posicional que usa 64 como base. Es la mayor potencia de dos que puede ser representada usando únicamente los caracteres imprimibles de ASCII. Esto ha propiciado su uso para codificación de correos [...]]]></description>
			<content:encoded><![CDATA[<p>El módulo de Perl MIME::Base64 proporciona funciones para codificar y descodificar cadenas en y desde base64.</p>
<blockquote><p>Base 64 es un sistema de numeración posicional que usa 64 como base. Es la mayor potencia de dos que puede ser representada usando únicamente los caracteres imprimibles de ASCII. Esto ha propiciado su uso para codificación de correos electrónicos, PGP y otras aplicaciones. Todas las variantes famosas que se conocen con el nombre de Base64 usan el rango de caracteres A-Z, a-z y 0-9 en este orden para los primeros 62 dígitos, pero los símbolos escogidos para los últimos dos dígitos varían considerablemente de unas a otras. <a href="http://es.wikipedia.org/wiki/Base64" target="_blank">Wikipedia</a></p></blockquote>
<p>Las funciones que nos ofrece son las siguientes:</p>
<p>encode_base64($str);<br />
encode_base64($str, $eol);<br />
decode_base64($str);</p>
<p>Os dejo un par de ejemplos muy sencillos, podéis encontrar más en <a href="http://search.cpan.org/~gaas/MIME-Base64-3.08/Base64.pm" target="_blank">cPan.org</a>.</p>
<p>Decodificación:</p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span><br />
<span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> MIME<span style="color: #339933;">::</span><span style="color: #006600;">Base64</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string_codificada</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;RXN0byBlcyB1bmEgcHJ1ZWJh&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=</span> decode_base64<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$codificado</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;String ($string_codificada) decodificada:<span style="color: #000099; font-weight: bold;">\n</span> &quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$string</span><span style="color: #339933;">;</span></div></div>
<p>Codificación:</p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span><br />
<span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> MIME<span style="color: #339933;">::</span><span style="color: #006600;">Base64</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'Esto es una prueba'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string_codificada</span> <span style="color: #339933;">=</span> encode_base64<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;String ($string) codificada:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$string_codificada</span><span style="color: #339933;">;</span></div></div>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/encriptacion-y-desencriptacion-con-gnupg/" title="Encriptación y desencriptación con GnuPG">Encriptación y desencriptación con GnuPG</a></li><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li><li><a href="http://rm-rf.es/encriptar-un-filesystem-con-luks-y-cryptsetup/" title="Encriptar un filesystem con LUKS y cryptsetup">Encriptar un filesystem con LUKS y cryptsetup</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/perl-encriptar-desencriptar-base64-mimebase64/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Shared object &#8220;libperl.so&#8221; not found</title>
		<link>http://rm-rf.es/shared-object-libperlso-not-found/</link>
		<comments>http://rm-rf.es/shared-object-libperlso-not-found/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 08:08:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[libperl.so]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl-after-upgrade]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=770</guid>
		<description><![CDATA[Tras la última actualización de cPanel en un servidor FreeBSD (11.24.4-RELEASE_33609), resulto haber un fallo en ciertos módulos de Perl, por ejemplo exim no arrancaba mostrando el siguiente error: # /scripts/restartsrv_exim /libexec/ld-elf.so.1: Shared object "libperl.so" not found, required by "exim" /libexec/ld-elf.so.1: Shared object "libperl.so" not found, required by "exim" Ni un upcp &#8211;force ni reinstalar [...]]]></description>
			<content:encoded><![CDATA[<p>Tras la última actualización de cPanel en un servidor FreeBSD (11.24.4-RELEASE_33609), resulto haber un fallo en ciertos módulos de Perl, por ejemplo exim no arrancaba mostrando el siguiente error:</p>
<pre># /scripts/restartsrv_exim
/libexec/ld-elf.so.1: Shared object "libperl.so" not found, required by "exim"
/libexec/ld-elf.so.1: Shared object "libperl.so" not found, required by "exim"</pre>
<p>Ni un upcp &#8211;force ni reinstalar exim solventan el fallo, es necesario realizar lo siguiente, ejecutad el script:</p>
<pre>/usr/local/bin/perl-after-upgrade -f</pre>
<p>Toda la información sobre este script <a href="http://people.freebsd.org/~tobez/pau.html">aquí</a>.</p>
<p>De este modo quedaría solucionado, podéis chequear tras dicha tarea que todo es correcto (Perl) chequeando los módulos con:</p>
<pre>/scripts/checkperlmodules --force</pre>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li><li><a href="http://rm-rf.es/pfsense-firewall-open-source-basado-en-freebsd/" title="pfSense: Firewall Open Source basado en FreeBSD">pfSense: Firewall Open Source basado en FreeBSD</a></li><li><a href="http://rm-rf.es/freebsd-comando-ps-no-muestra-todas-las-columnas/" title="FreeBSD: comando PS no muestra todas las columnas">FreeBSD: comando PS no muestra todas las columnas</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/shared-object-libperlso-not-found/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The perl module Text::CSV could not be installed</title>
		<link>http://rm-rf.es/the-perl-module-text-csv-could-not-be-installed/</link>
		<comments>http://rm-rf.es/the-perl-module-text-csv-could-not-be-installed/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 20:40:28 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[config read only]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[text csv]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=715</guid>
		<description><![CDATA[Tras actualizar un servidor FreeBSD a la última versión Release de cPanel (11.24.4-RELEASE_32603) me encontré con el siguiente error: The perl module Text::CSV could not be installed. This module is required by cPanel, and the system may not function correctly until it is installed, and functional. Below is the results of the auto-install attempt: Test [...]]]></description>
			<content:encoded><![CDATA[<p>Tras actualizar un servidor <strong>FreeBSD</strong> a la última versión Release de <strong>cPanel</strong> (11.24.4-RELEASE_32603) me encontré con el siguiente error:</p>
<p>The perl module Text::CSV could not be installed.</p>
<pre>This module is required by cPanel, and the system may not function correctly until it is installed, and functional.  Below is the results of the auto-install attempt:

Test Run
==============
Can't locate Text/CSV.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at - line 1.
BEGIN failed--compilation aborted at - line 1.

Installer Run
==============
%Config::Config is read-only</pre>
<p>Al tratar de reinstalar el módulo de Perl, ya sea desde WHM o desde línea de comandos seguía sin dejarme por el dichoso &#8220;<em><strong>%Config::Config is read-only</strong></em>&#8221; así que directamente reinstalando perl 5.8.8 el problema ha quedado solucionado:</p>
<pre>wget http://layer1.cpanel.net/perl588installer.tar.gz
tar xfvz perl588installer.tar.gz
cd perl588installer
./install</pre>
<p>Tras instalarlo revisa que todos los módulos han sido instalados correctamente:</p>
<pre>/scripts/checkperlmodules</pre>
<p>Si todo a ido bien, os indicará lo siguiente tras el chequeo:</p>
<pre>Using fast module check.....checked 110 modules in 19 second(s)
Tested 111, 111 ok, 0 failed.</pre>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li><li><a href="http://rm-rf.es/cpanel-11-25-error-en-modulo-perl-mailspf/" title="cPanel 11.25: error en módulo perl Mail::SPF">cPanel 11.25: error en módulo perl Mail::SPF</a></li><li><a href="http://rm-rf.es/actualizar-modulos-perl-cpan/" title="Actualizar todos los módulos de Perl desde CPAN">Actualizar todos los módulos de Perl desde CPAN</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/the-perl-module-text-csv-could-not-be-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS: Imposible ejecutar perl o php con Application Pool Isolation</title>
		<link>http://rm-rf.es/iis-imposible-ejecutar-perl-php-application-pool-isolation/</link>
		<comments>http://rm-rf.es/iis-imposible-ejecutar-perl-php-application-pool-isolation/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 18:02:20 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[application pool]]></category>
		<category><![CDATA[application pool isolation]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[windows 2003 server]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=712</guid>
		<description><![CDATA[Es posible que tengáis un servidor Windows 2003 server con IIS funcionando correctamente, los websites ejecutan sin problemas php o perl, pero en el momento que aislamos un website (Application Pool Isolation) tanto PERL como PHP dejan de funcionar, dando normalmente el siguiente error: HTTP Error 403 &#8211; Forbidden: Access is denied Este problema es [...]]]></description>
			<content:encoded><![CDATA[<p>Es posible que tengáis un <strong>servidor Windows 2003 server</strong> con <strong>IIS</strong> funcionando correctamente, los websites ejecutan sin problemas php o perl, pero en el momento que aislamos un website (<strong>Application Pool Isolation</strong>) tanto PERL como PHP dejan de funcionar, dando normalmente el siguiente error:</p>
<p><em>HTTP Error 403 &#8211; Forbidden: Access is denied</em></p>
<p>Este problema es debido a que cada identidad de application pool (usuario configurado en la aplicación para ejecución de scripts, php, etc) debe ser miembro del grupo <strong>IIS_WPG</strong> de modo que nos aseguremos que tenga permisos para ejecutar php o perl.</p>
<p>Realizaremos las siguientes modificaciones en las políticas de seguridad para solventar el problema, iremos a:</p>
<p><strong>START &gt; Administrative Tools &gt; Local Security Policy</strong></p>
<p>Seleccionamost <strong>Local Policies &gt; User Rights Assignment</strong></p>
<p>En el listado que aparezca, buscamos <strong>Adjust memory quotas for a process</strong> y pinchamos en las propiedades. Posteriormente <strong>Add User or Group &gt; Object Types</strong> marcando la casilla de  <strong>Groups </strong>y OK the Object Types dialogue. Ahora en la ventana <strong>Enter the object names to select </strong>introduce IIS_WPG y pincha OK.</p>
<p>El mismo proceso debe ser ejecutado en <strong>Replace a process level token</strong>. Reiniciaremos la máquina y ya debería funcionar correctamente. Todos los miembros de IIS_WPG pueden ejecutar aplicaciones CGI sin problemas.</p>
<p>Vía | <a href="http://support.asimo.nl/activekb/questions.php?questionid=6">Asimo Support</a></p>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/diferencias-entre-aplicacion-y-directorio-virtual-en-iis/" title="Diferencias entre aplicación y directorio virtual en IIS">Diferencias entre aplicación y directorio virtual en IIS</a></li><li><a href="http://rm-rf.es/vulnerabilidad-critica-en-instalaciones-de-php-basadas-en-cgi/" title="Vulnerabilidad crítica en instalaciones de PHP basadas en CGI">Vulnerabilidad crítica en instalaciones de PHP basadas en CGI</a></li><li><a href="http://rm-rf.es/instalar-iis-7-5-php-net-framework-o-sql-server-en-un-par-de-clicks-windows-7server-2008vista/" title="Instalar IIS 7.5, PHP, .NET Framework o SQL Server en un par de clicks (Windows 7/Server 2008/Vista)">Instalar IIS 7.5, PHP, .NET Framework o SQL Server en un par de clicks (Windows 7/Server 2008/Vista)</a></li><li><a href="http://rm-rf.es/instalar-ioncube-loader-windows/" title="Cómo instalar ionCube Loader en Windows">Cómo instalar ionCube Loader en Windows</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/iis-imposible-ejecutar-perl-php-application-pool-isolation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reemplazar texto en múltiples ficheros con Perl</title>
		<link>http://rm-rf.es/reemplazar-texto-en-multiples-ficheros-con-perl/</link>
		<comments>http://rm-rf.es/reemplazar-texto-en-multiples-ficheros-con-perl/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:09:32 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Comandos]]></category>
		<category><![CDATA[named]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[reemplazar]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://rm-rf.es/?p=518</guid>
		<description><![CDATA[Gracias a Perl, es muy sencillo realizar cambios en uno o varios ficheros sin necesidad de crear ningún script. Por ejemplo si necesitaramos cambiar la configuración DNS de dominios ubicados en la carpeta /var/named/ podemos hacerlo con un este comando: perl -i -pe "s/0.0.0.0/1.1.1.1/g" /var/named/dominio.com.db Si quisieramos hacerlo para todos los dominios: perl -i -pe [...]]]></description>
			<content:encoded><![CDATA[<p>Gracias a <strong>Perl</strong>, es muy sencillo realizar cambios en uno o varios ficheros sin necesidad de crear ningún script. Por ejemplo si necesitaramos cambiar la configuración DNS de dominios ubicados en la carpeta /var/named/ podemos hacerlo con un este comando:</p>
<pre>perl -i -pe "s/0.0.0.0/1.1.1.1/g" /var/named/dominio.com.db</pre>
<p>Si quisieramos hacerlo para todos los dominios:</p>
<pre>perl -i -pe "s/0.0.0.0/1.1.1.1/g" /var/named/*.db</pre>
<p>Optimizando un poco el comando, podemos además realizar un backup del fichero que estamos modificando por seguridad incluyendo lo siguiente (este ejemplo además de reemplazar la IP crearía un fichero de backup /var/named/dominio.com.db.bkp) :</p>
<pre>perl -i.bak -pe "s/0.0.0.0/1.1.1.1/g" /var/named/dominio.com.db</pre>
<p>Esto por supuesto también puede hacerse con otras herramientas, por ejemplo con <strong>sed</strong> o<strong> replace.</strong></p>
<h4  class="related_post_title">También te puede interesar:</h4><ul class="related_post"><li><a href="http://rm-rf.es/dns-configurar-bind-como-forward-only/" title="DNS: configurar bind como Forward Only">DNS: configurar bind como Forward Only</a></li><li><a href="http://rm-rf.es/bind-named-view-internal-in-rfc-1918-response-from-internet-for/" title="Bind-Named: view internal-in: RFC 1918 response from Internet for&#8230;">Bind-Named: view internal-in: RFC 1918 response from Internet for&#8230;</a></li><li><a href="http://rm-rf.es/db_file-xs101-db-h-no-such-file-or-directory/" title="DB_File.xs:101: db.h: No such file or directory">DB_File.xs:101: db.h: No such file or directory</a></li><li><a href="http://rm-rf.es/elegir-el-compilador-correcto-para-perl-en-solaris/" title="Elegir el compilador correcto para Perl en Solaris">Elegir el compilador correcto para Perl en Solaris</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://rm-rf.es/reemplazar-texto-en-multiples-ficheros-con-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

