<?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>Hobbestigrou</title>
	<atom:link href="http://hobbestigrou.interface-c.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hobbestigrou.interface-c.com</link>
	<description>Mon blog personnel</description>
	<lastBuildDate>Sun, 04 Jul 2010 13:06:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Rédacteur sur le blog des mongueurs.</title>
		<link>http://hobbestigrou.interface-c.com/redacteur-sur-le-blog-des-mongueurs/</link>
		<comments>http://hobbestigrou.interface-c.com/redacteur-sur-le-blog-des-mongueurs/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 13:02:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[gandi]]></category>
		<category><![CDATA[mongueurs]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/?p=375</guid>
		<description><![CDATA[Comme vous le savez peut-être déjà avec Dams un mongueurs qui est notamment l&#8217;auteur du module Perl Curses::Toolkit, nous avons mis en place des services de contenu dynamique. Pour commencer nous avons mis un planet qui tourne sur un serveur virtuel fourni par Gandi que nous tenons à remercier, et nous utilisons Perlanetanet et cherokee.1 [...]]]></description>
			<content:encoded><![CDATA[<p>Comme vous le savez peut-être déjà avec <strong>Dams</strong> un mongueurs qui est notamment l&#8217;auteur du module Perl <strong>Curses::Toolkit</strong>, nous avons mis en place des services de contenu dynamique. Pour commencer nous avons mis un planet qui tourne sur un serveur virtuel fourni par <strong>Gandi</strong> que nous tenons à remercier, et nous utilisons <strong>Perlanetanet</strong> et <strong>cherokee</strong>.<sup>1</sup> Nous avons aussi mis en place un blog pour relayer des informations plus facilement. Nous aimerions qu&#8217;il vive, nous faisons donc appel à  votre  contribution, si vous souhaiter traduire des articles anglais, relayer des news, écrire au sujet de modules, contacter-nous pour devenir rédacteur.  </p>
<p><img title="Drapeau Fr" src="http://linuxfr.org/images/fr.png" alt="Drapeau En" height="11" width="17"><a title="Planet" href="http://flake.mongueurs.net/" target="_blank">Planet</a><br />
<img title="Drapeau Fr" src="http://linuxfr.org/images/fr.png" alt="Drapeau En" height="11" width="17"><a title="Blog" href="http://mongueurs.typepad.com/" target="_blank">Blog</a></p>
<ol class="footnotes"><li id="footnote_0_375" class="footnote"> Je ferais un tour des points tech iques dans un prochaine article </li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/redacteur-sur-le-blog-des-mongueurs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl Console</title>
		<link>http://hobbestigrou.interface-c.com/perl-console-2/</link>
		<comments>http://hobbestigrou.interface-c.com/perl-console-2/#comments</comments>
		<pubDate>Mon, 24 May 2010 18:35:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Alexis Sukrieh]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Perl Console]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[REPL]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/perl-console-2/</guid>
		<description><![CDATA[Perl Console est-ce que l&#8217;on appel un REPL1. C&#8217;est-à-dire que cela fourni un environnement de programmation interactif. A la manière d&#8217;un shell, il sera possible d&#8217;exécuter des instructions du dit langage. Ce qui peut-être très pratique pour tester des instructions ou bibliothèques. Python en fourni un par défaut, mais ce n&#8217;est pas le cas de [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Perl Console</strong> est-ce que l&#8217;on appel un <strong>REPL</strong><sup>1</sup>. C&#8217;est-à-dire que cela fourni un environnement de programmation interactif. A la manière d&#8217;un shell, il sera possible d&#8217;exécuter des instructions du dit langage. Ce qui peut-être très pratique pour tester des instructions ou bibliothèques. <strong>Python</strong> en fourni un par défaut, mais ce n&#8217;est pas le cas de <strong>Perl</strong>. Il y a quelques semaines un ami m&#8217;a parlé de Perl Console, dans un premier temps je n&#8217;y ai pas prêté attention, puis finalement j&#8217;ai changé d&#8217;avis. Cela est très pratique pour tester rapidement des petits bouts de code ou autre, sans avoir besoin d&#8217;ouvrir un fichier pour 5 lignes et qui soit plus puissant que l&#8217;option -e qui permet d&#8217;évaluer du code de type <strong>perl -e &laquo;&nbsp;print &#8216;Hello World.&#8217;&nbsp;&raquo;</strong>. Depuis que je l&#8217;ai installé, j&#8217;en ai toujours un d&#8217;ouvert dans un coin.</p>
<p>Perl Console est écrit par <strong>Alexis Sukrieh</strong>. Il existe un paquet pour les distributions <strong>Debian</strong> est dérivées. Après avoir essayé plusieurs REPL pour Perl, j&#8217;ai choisis Perl Console. Il est simple, fait exactement ce que je cherchais, il y a la complétion et il est écrit par l&#8217;auteur de <strong>Dancer</strong> un framework web que j&#8217;utilise.</p>
<p><img title="Drapeau En" src="http://linuxfr.org/images/en.png" alt="Drapeau En" height="11" width="17"><a title="Page du projet" href="http://www.sukria.net/perlconsole.html" target="_blank">Page de présentation</a></p>
<ol class="footnotes"><li id="footnote_0_373" class="footnote"> Read-eval-print loop </li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/perl-console-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mairix indexer et chercher ses mails</title>
		<link>http://hobbestigrou.interface-c.com/mairix-indexer-et-chercher-ses-mails/</link>
		<comments>http://hobbestigrou.interface-c.com/mairix-indexer-et-chercher-ses-mails/#comments</comments>
		<pubDate>Sun, 02 May 2010 11:55:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Logiciel libre]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[maildir]]></category>
		<category><![CDATA[mails]]></category>
		<category><![CDATA[Mairix]]></category>
		<category><![CDATA[mbox]]></category>
		<category><![CDATA[Mutt]]></category>
		<category><![CDATA[recherche]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/mairix-indexer-et-chercher-ses-mails/</guid>
		<description><![CDATA[Mairix est un outil qui permet d&#8217;indexer et chercher ses mails. Lorsque vous ferez une recherche le résultat sera créé dans une boite. Il est possible d&#8217;utiliser le format mbox ou Maildir. Mairix est très pratique pour être utilisé avec Mutt. Nous allons commencer par l&#8217;installer, pour Debian et dérivés il existe un paquet. ?View [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Mairix</strong> est un outil qui permet d&#8217;indexer et chercher ses mails. Lorsque vous ferez une recherche le résultat sera créé dans une boite. Il est possible d&#8217;utiliser le format <strong>mbox</strong> ou <strong>Maildir</strong>. Mairix est très pratique pour être utilisé avec <strong>Mutt</strong>. </p>
<p>Nous allons commencer par l&#8217;installer, pour Debian et dérivés il existe un paquet.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p371code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3717"><td class="code" id="p371code7"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mairix</pre></td></tr></table></div>

<p>Il nous faudra un fichier de configuration pour mairix qui sera /home/hobbestigrou/.mairixrc Ci-dessous un exemple de configuration :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p371code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3718"><td class="code" id="p371code8"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># the base where our mail is stored, and where we put the mairix database</span>
<span style="color: #007800;">base</span>=~<span style="color: #000000; font-weight: bold;">/</span>Mail
<span style="color: #007800;">database</span>=~<span style="color: #000000; font-weight: bold;">/</span>.mairix<span style="color: #000000; font-weight: bold;">/</span>database
&nbsp;
<span style="color: #666666; font-style: italic;"># this needs to be a full path for our msearch script (which deletes the</span>
<span style="color: #666666; font-style: italic;"># mbox if it exists to replace it with new search results)</span>
<span style="color: #007800;">mformat</span>=mbox
<span style="color: #007800;">mfolder</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>utilisateur<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>mairix-search
&nbsp;
<span style="color: #666666; font-style: italic;"># index everything in $base, recursively</span>
<span style="color: #007800;">mbox</span>=<span style="color: #000000; font-weight: bold;">*</span>...
&nbsp;
<span style="color: #666666; font-style: italic;"># don't index our spam folders</span>
<span style="color: #007800;">omit</span>=Spam:.procmail.log</pre></td></tr></table></div>

<p>Je pense que le fichier est assez commenté et ce passe d&#8217;explication. </p>
<p>Pour l&#8217;utiliser avec Mutt il vous faudra faire deux ou trois petites choses. Nous allons commencer par ajouter ce script bash dans notre répertoire .mutt , si il n&#8217;existe pas créer le.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p371code9'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3719"><td class="code" id="p371code9"><pre class="bash" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">#!/bin/sh </span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># $Id: msearch.sh 30 2007-04-08 15:41:53Z vdanen $</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># wrapper script to execute mairix searches</span>
&nbsp;
  <span style="color: #007800;">mairix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mairix
  <span style="color: #007800;">mairixrc</span>=~<span style="color: #000000; font-weight: bold;">/</span>.mairixrc
&nbsp;
  <span style="color: #007800;">mbox</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`grep mfolder ${mairixrc} | cut -d '=' -f 2`</span>&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Deleting old results folder...&quot;</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${mbox}</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating index...&quot;</span>
  <span style="color: #800000;">${mairix}</span> <span style="color: #660033;">-p</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Executing mairix search...&quot;</span>
  <span style="color: #800000;">${mairix}</span> <span style="color: #007800;">$*</span></pre></td></tr></table></div>

<p>Ensuite dans le fichier de configuration mutt $HOME/.muttrc nous allons ajouter des macros.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p371code10'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37110"><td class="code" id="p371code10"><pre class="bash" style="font-family:monospace;">  macro index <span style="color: #ff0000;">&quot;\em&quot;</span>    <span style="color: #ff0000;">&quot;&lt;shell-escape&gt;<span style="color: #007800;">$HOME</span>/.mutt/msearch.sh &quot;</span> <span style="color: #ff0000;">&quot;Run a Mairix search&quot;</span>
  macro index <span style="color: #ff0000;">&quot;\ef&quot;</span>    <span style="color: #ff0000;">&quot;&lt;change-folder-readonly&gt;=mairix-search<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #ff0000;">&quot;Switch to Mairix search results&quot;</span>
&nbsp;
  macro pager <span style="color: #ff0000;">&quot;\em&quot;</span>    <span style="color: #ff0000;">&quot;&lt;shell-escape&gt;<span style="color: #007800;">$HOME</span>/.mutt/msearch.sh &quot;</span> <span style="color: #ff0000;">&quot;Run a Mairix search&quot;</span>
  macro pager <span style="color: #ff0000;">&quot;\ef&quot;</span>    <span style="color: #ff0000;">&quot;&lt;change-folder-readonly&gt;=mairix-search<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #ff0000;">&quot;Switch to Mairix search results&quot;</span></pre></td></tr></table></div>

<p>La combinaison esc+m Permettra de lancer une recherche et la combinaison esc+f permettra de se déplacer dans la boite. Nous ajouterons aussi toujours dans le .muttrc</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p371code11'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37111"><td class="code" id="p371code11"><pre class="bash" style="font-family:monospace;">  mailboxes =mairix-search</pre></td></tr></table></div>

<p>Vous pourrez désormais essayer de lancer une recherche.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p371code12'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37112"><td class="code" id="p371code12"><pre class="bash" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">#Vous verrez une ligne de ce type, indiquer l'occurence à la suite. </span>
  Commande shell : <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>utilisateur<span style="color: #000000; font-weight: bold;">/</span>.mutt<span style="color: #000000; font-weight: bold;">/</span>msearch.sh une_recherche</pre></td></tr></table></div>

<p>Il est possible de filtrer pour chercher uniquement dans le sujet par exemple avec s:une_recherche, ou dans le corps avec b:une_recherche. Si rien n&#8217;est spécifié il cherchera dans tous les champs. N&#8217;hésiter pas à lire le man de mairix pour connaître toutes ses possibilités. Lorsque vous lancerez une recherche pour la première cela sera un peu long selon la quantité et poids des mails, car il va créer l&#8217;index. Ensuite cela sera rapide, c&#8217;est incrémental c&#8217;est-à-dire qu&#8217;il va chercher que dans les nouveaux mails pour récréer l&#8217;index.</p>
<p><img width="17" height="11" title="Drapeau En" src="http://linuxfr.org/images/en.png" alt="Drapeau En"><a title="Site du projet" href="http://www.rpcurnow.force9.co.uk/mairix/" target="_blank">Site du projet</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/mairix-indexer-et-chercher-ses-mails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Supprimer les doublons dans un tableau Perl.</title>
		<link>http://hobbestigrou.interface-c.com/supprimer-les-doublons-dans-un-tableau-perl/</link>
		<comments>http://hobbestigrou.interface-c.com/supprimer-les-doublons-dans-un-tableau-perl/#comments</comments>
		<pubDate>Sun, 02 May 2010 11:09:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Hash]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[push]]></category>
		<category><![CDATA[Tableau]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/supprimer-les-doublons-dans-un-tableau-perl/</guid>
		<description><![CDATA[Vous souhaitez récupérer des valeurs d&#8217;un tableau, mais certaines sont en double. Vous ne souhaitez pas dupliquer l&#8217;information. Le but est donc de trouver un moyen de supprimer les doublons. Je vais vous présenter une solution qui n&#8217;est certainement pas la plus rapide ou la meilleur, mais la plus direct auquel on pense en premier. [...]]]></description>
			<content:encoded><![CDATA[<p>Vous souhaitez récupérer des valeurs d&#8217;un tableau, mais certaines sont en double. Vous ne souhaitez pas dupliquer l&#8217;information. Le but est donc de trouver un moyen de supprimer les doublons. Je vais vous présenter une solution qui n&#8217;est certainement pas la plus rapide ou la meilleur, mais la plus direct auquel on pense en premier.</p>
<p> En <strong>Perl</strong> on utilise généralement un hash pour répondre à ce genre de problème. Nous allons suivre cette méthode et utiliser un hash qui va s&#8217;occuper de mémoriser les éléments déjà rencontré. Je vais montrer un exemple de code et l&#8217;expliquerai après<sup>1</sup>.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p370code15'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37015"><td class="code" id="p370code15"><pre class="perl" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">#Tableau d'origine</span>
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@tab</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'la'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'toi'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'la'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'si'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'ba'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'ben'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'la'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#Déclaration d'un hash vide qui contiendra les élément déjà rencontré</span>
  <span style="color: #666666; font-style: italic;">#et d'un tableau vide qui contiendra le résultat.</span>
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%deja_vu</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@uniques</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#Parcours du tableau</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$objet</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@tab</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
      <span style="color: #666666; font-style: italic;">#Si la valeur n'est pas déjà dans le hash deja_vu</span>
      <span style="color: #b1b100;">unless</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$deja_vu</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$objet</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #666666; font-style: italic;">#Stocke la valeur de l'itération comme clé dans</span>
          <span style="color: #666666; font-style: italic;">#le hash deja_vu </span>
          <span style="color: #0000ff;">$deja_vu</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$objet</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">;</span>
          <span style="color: #666666; font-style: italic;">#Stocke la valeur dans le tableau uniques</span>
          <a href="http://perldoc.perl.org/functions/push.html"><span style="color: #000066;">push</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@uniques</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$objet</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;Tableau avec des doublons (@tab)&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
  <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;Tableau sans doublons (@uniques)&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>La deuxième ligne contient notre tableau de départ. On peut constater qu&#8217;on rencontre certaines valeurs plusieurs fois notamment la valeur <strong>la</strong>, qui est présente trois fois.<br />
 A la ligne 6 nous déclarons et initialisation un hash vide qui contiendra comme clé les valeurs déjà rencontrés.<br />
 Ligne 7 nous déclarons et initialisation un tableau vide qui sera le tableau final, dans lequel on va ajouter la valeur si elle n&#8217;est pas déjà connu.<br />
 Ligne 12 nous avons une condition qui test si la valeur du tableau n&#8217;existe pas déjà dans le hash, si elle n&#8217;existe pas on rentre dans la condition. Ce qui signifie qu&#8217;à la première itération il va tester si la valeur <strong>la</strong> est déjà une clé du hash deja_vu, elle ne l&#8217;ait pas on rentre donc dans la condition, mais à la troisième itération on a de nouveau la valeur <strong>la</strong>, elle est déjà présente dans le hash on ne rentre donc pas dans la condition.<br />
Ligne 15 on insère la valeur comme clé. Pour la première itération nous allons donc stocker la clé <strong>la</strong> :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p370code16'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37016"><td class="code" id="p370code16"><pre class="bash" style="font-family:monospace;">    la =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">1</span>,</pre></td></tr></table></div>

<p> A la ligne 17 on ajoute la valeur à la fin du tableau avec la fonction push. Pour la première itération nous allons donc ajouter la valeur <strong>la</strong> au tableau uniques. La deuxième itération va ajouter <strong>toi</strong> elle sera ajouté après l&#8217;élément la à l&#8217;indice 1, et ainsi de suite. Nous allons donc retrouver le même structure que le tableau de départ, les valeurs seront stockés dans le même ordre avec les doublons en moins.</p>
<p> Dans les deux dernière lignes nous affichons les deux tableaux trié et non trié. </p>
<p> En conclusion ceci est un exemple, il en existe d&#8217;autres, mais cette solution fait partie de celle qui répondra à votre problème.</p>
<ol class="footnotes"><li id="footnote_0_370" class="footnote"> Le code source est tiré du Perl Cookbook </li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/supprimer-les-doublons-dans-un-tableau-perl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Éditeur de texte par défaut</title>
		<link>http://hobbestigrou.interface-c.com/editeur-de-texte-par-defaut/</link>
		<comments>http://hobbestigrou.interface-c.com/editeur-de-texte-par-defaut/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 21:05:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Gnu/linux]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[éditeur]]></category>
		<category><![CDATA[EDITOR]]></category>
		<category><![CDATA[env]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Nano]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[VISUAL]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/editeur-de-texte-par-defaut/</guid>
		<description><![CDATA[Une technique bien connu des personnes utilisant un système Gnu/linux quotidiennement, peut-être moins des nouveaux utilisateurs. Je cherche surtout une excuse, car j&#8217;avais envie d&#8217;écrire, mais quelque chose de vraiment facile, par flemme. Sur un système Gnu/linux lorsqu&#8217;on lance certaines applications comme crontab par exemple, nécessitant une édition, la dite application fera appel à l&#8217;éditeur [...]]]></description>
			<content:encoded><![CDATA[<p>Une technique bien connu des personnes utilisant un système Gnu/linux quotidiennement, peut-être moins des nouveaux utilisateurs. Je cherche surtout une excuse, car j&#8217;avais envie d&#8217;écrire, mais quelque chose de vraiment facile, par flemme. </p>
<p>Sur un système Gnu/linux lorsqu&#8217;on lance certaines applications comme <strong>crontab</strong> par exemple, nécessitant une édition, la dite application fera appel à l&#8217;éditeur configuré par défaut. Ce qui est généralement <strong>Nano</strong> donc pas génial, bien-sûr ce n&#8217;est que mon avis. Fort heureusement il est possible de modifier cela et configurer notre éditeur de texte favori, tout le monde est au courant que c&#8217;est <strong>Vim</strong> le meilleur. Pour ce faire nous allons modifier les variables d&#8217;environnement. Pour une application permanente nous éditerons le fichier $HOME/.bashrc et nous ajouterons ces quelques lignes.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p369code20'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36920"><td class="code" id="p369code20"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">EDITOR</span>=<span style="color: #c20cb9; font-weight: bold;">vim</span>
<span style="color: #007800;">VISUAL</span>=<span style="color: #007800;">$EDITOR</span>
<span style="color: #7a0874; font-weight: bold;">export</span> EDITOR VISUAL</pre></td></tr></table></div>

<p>Utilisez la commande <strong>source</strong> pour mettre à jour votre <strong>bashrc</strong>.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p369code21'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36921"><td class="code" id="p369code21"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></td></tr></table></div>

<p>Utilisez la commande <strong>env</strong> ou afficher les variables avec <strong>echo</strong> pour vous assurer que cela a été pris en compte.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p369code22'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36922"><td class="code" id="p369code22"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$EDITOR</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$VISUAL</span></pre></td></tr></table></div>

<p>Il est préférable de bien configurer les deux variables.<strong>Viusal</strong>, est un ancien terme qui ne devrait plus être utilisé, mais certaines applications y font encore appelle. Il sera possible de configurer n&#8217;importe quel éditeur, mais il est recommandé d&#8217;en choisir un en mode texte. Il sera possible si vous le désirez de choisir un éditeur muni d&#8217;une <strong>GUI</strong>, mais n&#8217;oublier pas que cela ne fonctionnera que si <strong>X</strong> est disponible. </p>
]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/editeur-de-texte-par-defaut/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Présentation des tableaux en Perl.</title>
		<link>http://hobbestigrou.interface-c.com/presentation-des-tableaux-en-perl/</link>
		<comments>http://hobbestigrou.interface-c.com/presentation-des-tableaux-en-perl/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 20:30:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[Barthez]]></category>
		<category><![CDATA[foo]]></category>
		<category><![CDATA[football]]></category>
		<category><![CDATA[hachage]]></category>
		<category><![CDATA[Hash]]></category>
		<category><![CDATA[Henry]]></category>
		<category><![CDATA[Liste]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[Tableau]]></category>
		<category><![CDATA[Zidane]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/presentation-des-tableaux-en-perl/</guid>
		<description><![CDATA[J&#8217;ai ouvert une catégorie programmation, il y a quelques semaines. J&#8217;y ai déjà posté des articles et je compte continuer. Je vais essayer1 de faire plus d&#8217;articles sur la programmation et notamment à propos de Perl. Les articles pourraient paraître un peu trop pris par la main, même pour certaines choses assez simple, c&#8217;est pour [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;ai ouvert une catégorie programmation, il y a quelques semaines. J&#8217;y ai déjà posté des articles et je compte continuer. Je vais essayer<sup>1</sup> de faire plus d&#8217;articles sur la programmation et notamment à propos de <strong>Perl</strong>. Les articles pourraient paraître un peu trop pris par la main, même pour certaines choses assez simple, c&#8217;est pour que tout le monde puisse suivre y compris les débutants. Certains articles pourraient paraître sans intérêt et trop détaillés pour des concepts pourtant simple à comprendre, mais moi ça me plaît. Cela va me forcer à m&#8217;entraîner à bien expliquer les choses, car ce n&#8217;est pas forcément mon fort, et être encore un peu meilleur et plus à l&#8217;aise, chaque explication et relecture apporte une nouvelle compréhension, c&#8217;est le même principe que la pratique, c&#8217;est donc important surtout pour moi. Pour écrire mes articles je servirais de mes connaissances personnelles et pour structurer mes idées je m&#8217;aiderai généralement de différent écrits de référence que j&#8217;aurais pu lire, malgré que cela sera avec ma vision, il pourrait arriver que certains passage puissent vous sembler familiers<sup>2</sup>. Désolé pour cette introduction un peu longue ça sera la dernière fois.</p>
<p>Je vais présenter un peu l&#8217;idée du fonctionnement des tableaux en <strong>Perl</strong>. Pour commencer le plus simple serait de prendre un exemple du monde réel. Par exemple si on vous demande de citer le nom des joueurs d&#8217;une équipe de football. Vous allez tout simplement réciter une liste, vous allez donner un nom l&#8217;un après l&#8217;autre dans un ordre particulier. <strong>Perl</strong>  dispose de primitives puissantes pour manipuler les listes et les tableaux. Il existe une différence entre les listes et les tableaux en <strong>Perl</strong>  bien quel soit minime.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p367code29'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36729"><td class="code" id="p367code29"><pre class="perl" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Barthez&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Zidane&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Henry&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Nous avons donc une liste de trois footballeurs faisant parti de l&#8217;équipe de France en 98<sup>3</sup> , dans l&#8217;ordre<sup>4</sup> . On va maintenant stocker cette liste dans une variable pour pouvoir la réutiliser, nous allons utiliser un tableau.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p367code30'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36730"><td class="code" id="p367code30"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@players</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Barthez&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Zidane&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Henry&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>On peut constater que les deux exemples sont des groupes ordonnés de valeurs, la seul différence c&#8217;est qu&#8217;un tableau et une variable qui porte un nom, il sera donc possible d&#8217;effectuer des actions sur un tableau comme modifier sa longueur, alors qu&#8217;une liste est une notion plus éphémère. Finalement on peut se présenter un tableau comme une variable et une liste comme les valeurs qu&#8217;elle contient.</p>
<p>Comme-dit c&#8217;est une différence minime, mais qui est tout de même bien présente. Il ne sera par exemple pas possible d&#8217;effectuer des opérations sur une liste.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p367code31'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36731"><td class="code" id="p367code31"><pre class="perl" style="font-family:monospace;"><a href="http://perldoc.perl.org/functions/pop.html"><span style="color: #000066;">pop</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@tab</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Cela fonctionne.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p367code32'); return false;">View Code</a> -</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36732"><td class="code" id="p367code32"><pre class="-" style="font-family:monospace;">pop(1,2,3);</pre></td></tr></table></div>

<p>Ici par-contre il y a un problème la fonction pop à besoin d&#8217;un identifiant et pas d&#8217;une liste de valeurs. </p>
<p>En conclusion, ce qu&#8217;il faut retenir c&#8217;est que les listes et les tableaux sont des groupements ordonnés de scalaires. Comme dans tout langage il existe des opérateurs et fonctions travaillant sur des listes et des tableaux proposant un accès plus rapide et pratique qu&#8217;un accès manuel aux éléments. </p>
<p>En <strong>Perl</strong> il n&#8217;est pas possible d&#8217;imbriquer des parenthèses pour créer une liste de liste.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p367code33'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36733"><td class="code" id="p367code33"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@tab_imb</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;bar&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;un&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;exemple&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@tab_imb</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;bar&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;un&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;exemple&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Les deux lignes sont donc équivalentes. Si notre besoin est un peu plus complexe et qu&#8217;on a besoin de manipuler une structure de données un peu particulière comme un tableau de hachage, ou un tableau de tableau, il nous faudra utiliser des références. Les scalaires peuvent contenir des nombres, des chaines mais aussi des références. En Perl c&#8217;est toujours en utilisant des références que l&#8217;on met en place des structures complexes à plusieurs niveau. C&#8217;est de cette manière que sont implémentés des tableaux à deux dimensions, sous la forme de tableaux de références à des tableaux, un peu de la même manière qu&#8217;avec le <strong>langage C</strong>, les tableaux à deux dimensions sont des tableaux de pointeurs vers des tableaux.</p>
<p>Les scalaires d&#8217;un tableau sont des éléments et on peut y accéder en indiquant leur indice. Comme dans beaucoup de langage le premier élément d&#8217;un tableau en Perl est égal à 0.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p367code34'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36734"><td class="code" id="p367code34"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@players</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Barthez&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Zidane&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Henry&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Le scalaire <strong>Barthez</strong> se trouve en première position du tableau, mais comme-dit on y accède de cette manière <strong>@players[0]</strong>. L&#8217;élément <strong>Zidane</strong> ce trouve en deuxième position et on y accède de cette manière <strong>@players[1]</strong>.</p>
<p>En conclusion on a vu une première approche du fonctionnement des tableaux en <strong>Perl</strong>, on connaît à présent la différence entre un tableau et une liste, on sait comment accéder à un élément du tableau et on a une vague idée du fonctionnement des structures de données un peu plus complexe. Cela n&#8217;est bien-sur pas suffisant, mais vous permet de pouvoir commencer à utiliser des tableaux, comme-dit j&#8217;écrirai plus souvent la prochaine fois il est possible qu&#8217;on voit, comment supprimer les doublons d&#8217;un tableau, ou encore comment utiliser des tableaux dans ses programmes, ou alors comment trier un tableau. </p>
<ol class="footnotes"><li id="footnote_0_367" class="footnote"> En espérant que je trouve des choses à raconter assez souvent, ce n&#8217;est pas toujours simple </li><li id="footnote_1_367" class="footnote"> En Perl, je pourrais par exemple m&#8217;aider du CamelBook, ou encore Perl le Livre de recettes et de différente documentation </li><li id="footnote_2_367" class="footnote"> championne du monde </li><li id="footnote_3_367" class="footnote"> L&#8217;ordre étant dans ce cas les postes respectif de chacun, gardien de but, ensuite milieu de terrain, puis pour finir attaquant </li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/presentation-des-tableaux-en-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gérer vos plugins Vim à la manière d&#8217;apt-get avec Vimana.</title>
		<link>http://hobbestigrou.interface-c.com/gerer-vos-plugins-vim-a-la-maniere-dapt-get-avec-vimana/</link>
		<comments>http://hobbestigrou.interface-c.com/gerer-vos-plugins-vim-a-la-maniere-dapt-get-avec-vimana/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 22:27:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Gnu/linux]]></category>
		<category><![CDATA[apt get]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[Vimana]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Yo-An Lin]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/gerer-vos-plugins-vim-a-la-maniere-dapt-get-avec-vimana/</guid>
		<description><![CDATA[Vimana est un outil écrit en Perl par Yo-An Lin. Il vous permettra de gérer vos scripts Vim en ligne de commande à la manière d&#8217;un gestionnaire de paquet comme apt-get par exemple. Vous pourrez obtenir des informations, installer et mettre à jours vos scripts Vim1 . Selon le type du script ftplugin, plugin, syntax [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Vimana</strong> est un outil écrit en Perl par <strong>Yo-An Lin</strong>. Il vous permettra de gérer vos scripts Vim en ligne de commande à la manière d&#8217;un gestionnaire de paquet comme apt-get par exemple. Vous pourrez obtenir des informations, installer et mettre à jours vos scripts Vim<sup>1</sup> . Selon le type du script ftplugin, plugin, syntax etc&#8230; Vimana  installera les fichiers dans les répertoires correspondants. Par exemple pour un color scheme il le placera dans ~/.vim/colors/ </p>
<p>Pour installer Vimana il vous faudra passer par le CPAN. Il est disponible que pour des systèmes de type <strong>Unix</strong>, par exemple <strong>Gnu/linux</strong>, <strong>Mac OS X</strong>, <strong>BSD</strong> etc&#8230; Il n&#8217;est pas portable sur <strong>Windows</strong>.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code44'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36544"><td class="code" id="p365code44"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> cpan Vimana</pre></td></tr></table></div>

<p>Une fois installé vous pourrez commencer par mettre à jour l&#8217;index.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code45'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36545"><td class="code" id="p365code45"><pre class="bash" style="font-family:monospace;">vimana update</pre></td></tr></table></div>

<p>Pour chercher un script ou un plugin.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code46'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36546"><td class="code" id="p365code46"><pre class="bash" style="font-family:monospace;">vimana s Perl</pre></td></tr></table></div>

<p>Le résultat vous retourna donc des scripts concernant Perl<sup>2</sup> .</p>
<p>Vous pourrez aussi avoir des informations sur un script.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code47'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36547"><td class="code" id="p365code47"><pre class="bash" style="font-family:monospace;">vimana info omniperl</pre></td></tr></table></div>

<p>Pour installer un script.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code48'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36548"><td class="code" id="p365code48"><pre class="bash" style="font-family:monospace;">Vimana i autocomplop</pre></td></tr></table></div>

<p>Si le script n&#8217;est pas disponible sur vim.org, mais qu&#8217;il utilise un repository <strong>Git</strong> il sera possible d&#8217;indiquer le chemin du repository.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code49'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36549"><td class="code" id="p365code49"><pre class="bash" style="font-family:monospace;">vimana i <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>repository</pre></td></tr></table></div>

<p>Pour finir il est aussi possible d&#8217;installer un script depuis un répertoire.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code50'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36550"><td class="code" id="p365code50"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>repo.git
<span style="color: #7a0874; font-weight: bold;">cd</span> repo
vimana i .</pre></td></tr></table></div>

<p>Pour supprimer un script.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code51'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36551"><td class="code" id="p365code51"><pre class="bash" style="font-family:monospace;">vimana remove autocomplop</pre></td></tr></table></div>

<p>Ou encore</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code52'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36552"><td class="code" id="p365code52"><pre class="bash" style="font-family:monospace;">vimana remove autocomplop <span style="color: #660033;">--force</span></pre></td></tr></table></div>

<p>En conclusion, c&#8217;est un outil qui peut-être très pratique et faire gagner du temps, ça évitera de se rendre à chaque fois sur vim.org pour télécharger le script ou faire une recherche. </p>
<p><img width="17" height="11" alt="Drapeau En" src="http://linuxfr.org/images/en.png" title="Drapeau En"><a target="_blank" href="http://search.cpan.org/dist/Vimana/" title="Installer Vimana">Vimana sur le CPAN</a><br />
<img width="17" height="11" alt="Drapeau En" src="http://linuxfr.org/images/en.png" title="Drapeau En"><a target="_blank" href="http://github.com/c9s/Vimana" title="Repository Vimana">Vimana sur github</a><br />
<img width="17" height="11" alt="Drapeau En" src="http://linuxfr.org/images/en.png" title="Drapeau En"><a target="_blank" href="http://c9s.blogspot.com/" title="Blog de l'auteur">Blog de Yo-An Lin</a></p>
<ol class="footnotes"><li id="footnote_0_365" class="footnote"> Il va les chercher sur vim.org </li><li id="footnote_1_365" class="footnote"> Ayant Perl dans le nom ou la description du script </li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/gerer-vos-plugins-vim-a-la-maniere-dapt-get-avec-vimana/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Documenter vos codes</title>
		<link>http://hobbestigrou.interface-c.com/documenter-vos-codes/</link>
		<comments>http://hobbestigrou.interface-c.com/documenter-vos-codes/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 18:44:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[HelloWorld]]></category>
		<category><![CDATA[JavaDoc]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Perldoc]]></category>
		<category><![CDATA[POD]]></category>
		<category><![CDATA[Pydoc]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/documenter-vos-codes/</guid>
		<description><![CDATA[Lorsqu&#8217;on programme une chose importante est de bien documenter son code. Que cela soit pour vous, ou pour les personnes qui utiliseront votre code, ou passeront derrière vous. Tous les langages possède un système de documentation interne Perldoc, Javadoc, Pydoc etc&#8230; Par exemple en Python pour documenter une fonction nous utiliseront les triples quotes, tout [...]]]></description>
			<content:encoded><![CDATA[<p>Lorsqu&#8217;on programme une chose importante est de bien documenter son code. Que cela soit pour vous, ou pour les personnes qui utiliseront votre code, ou passeront derrière vous. Tous les langages possède un système de documentation interne Perldoc, Javadoc, Pydoc etc&#8230;<br />
Par exemple en Python pour documenter une fonction nous utiliseront les triples quotes, tout de suite après sa définition.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p363code54'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36354"><td class="code" id="p363code54"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> HelloWorld<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> :
    <span style="color: #483d8b;">&quot;&quot;&quot; Une simple fonction qui affiche un message à l'écran &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;HelloWorld !<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span></pre></td></tr></table></div>

<p>La description sera donc disponible via la pydoc.</p>
<p>En Perl nous avons le format Pod<sup>1</sup> , la bonne vielle documentation.</p>
<p>Pod est un lagage de balisage qui va permettre d&#8217;écrire de la documentation pour Perl, pour vos programmes Perl, ou encore pour vos modules Perl. Il sera ensuite possible de convertir POD dans différents formats notamment du texte brute, HTML, page de man. Je vous expliquerai dans un prochain article comment utiliser POD.</p>
<p><img width="17" height="11" alt="Drapeau Fr" src="http://linuxfr.org/images/fr.png" title="Drapeau Fr"><a target="_blank" href="http://perl.enstimac.fr/DocFr/perlpod.html" title="Documentation POD">Documentation POD sur enstimac</a></p>
<ol class="footnotes"><li id="footnote_0_363" class="footnote">Plain Old documentation</li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/documenter-vos-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Divers Tips Git</title>
		<link>http://hobbestigrou.interface-c.com/divers-tips-git/</link>
		<comments>http://hobbestigrou.interface-c.com/divers-tips-git/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 19:52:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[gestion de version]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[git couleurs]]></category>
		<category><![CDATA[gitconfig]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/divers-tips-git/</guid>
		<description><![CDATA[J&#8217;utilise désormais Git comme outil de gestion de version pour mes projets et diverses autres choses, fichier de configuration, document rédigé avec LaTeX etc&#8230; Je cherchais donc tout naturellement une méthode pour avoir un peu de couleurs. Contrairement à Subversion il n&#8217;y a pas besoin de faire appel à des outils externes pour cela. Il [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;utilise désormais <b>Git</b> comme outil de gestion de version pour mes projets et diverses autres choses, fichier de configuration, document rédigé avec LaTeX etc&#8230; Je cherchais donc tout naturellement une méthode pour avoir un peu de couleurs. Contrairement à <b>Subversion</b> il n&#8217;y a pas besoin de faire appel à des outils externes pour cela. Il vous suffira d&#8217;éditer votre fichier .gitconfig. Vous avez donc plusieurs manières de procéder pour ça, soit en ligne de commande via la commande git config, soit en éditant directement ce dit fichier.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p354code59'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35459"><td class="code" id="p354code59"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.branch auto
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.diff auto
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.interactive auto
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.status auto</pre></td></tr></table></div>

<p>Ce qui donnera dans le fichier de configuration ~/.gitconfig :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p354code60'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35460"><td class="code" id="p354code60"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>color<span style="color: #7a0874; font-weight: bold;">&#93;</span>                                                                                                                                               
        branch = auto
        <span style="color: #c20cb9; font-weight: bold;">diff</span> = auto
        interactive = auto
        status = auto</pre></td></tr></table></div>

<p>C&#8217;est tout de même plus agréable de voir un peu de couleurs. </p>
<p>Si vous êtes désireux d&#8217;avoir des alias avec Git similaire à svn pour le status, commit, branch etc&#8230; Vous pourrez encore une fois l&#8217;indiquer via git config.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p354code61'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35461"><td class="code" id="p354code61"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> alias.st status
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> alias.ci commit
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> alias.co checkout
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> alias.br branch</pre></td></tr></table></div>

<p>Ce qui vous permettra maintenant de taper par exemple :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p354code62'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35462"><td class="code" id="p354code62"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> st <span style="color: #666666; font-style: italic;">#En lieu et place de git status</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> ci <span style="color: #666666; font-style: italic;">#à la place de git commit</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">co</span> <span style="color: #666666; font-style: italic;">#à la place de git checkout</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> br <span style="color: #666666; font-style: italic;">#à la place de git br</span></pre></td></tr></table></div>

<p>Ce qui est un peu plus court ça fera du bien à vos doigts. Je rappel que la commande git checkout permet de changer de branche et non de récupérer les sources d&#8217;un dépôt contrairement à svn. J&#8217;avais déjà indiqué les commandes à utiliser pour, indiquer des informations sur votre nom d&#8217;utilisateur et l&#8217;éditeur lorsque j&#8217;avais présenté <a href="http://hobbestigrou.interface-c.com/decouverte-de-git-2/">Git</a>.</p>
<p>Il peut-être très pratique d&#8217;avoir accès à un aide-mémoire des diverses commandes disponible, car il arrive d&#8217;avoir de trous. Il en existe pour cela <a href="http://cheat.errtheblog.com/s/git">cheat git</a>. Il existe aussi des versions svg ou png <a href="http://github.com/guides/git-cheat-sheet">Disponible ici</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/divers-tips-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installer un module Perl</title>
		<link>http://hobbestigrou.interface-c.com/installer-un-module-perl/</link>
		<comments>http://hobbestigrou.interface-c.com/installer-un-module-perl/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 18:52:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Archive::Tar]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[gunzip]]></category>
		<category><![CDATA[lib]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[Net::Twitter]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Tar]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://hobbestigrou.interface-c.com/installer-un-module-perl/</guid>
		<description><![CDATA[Il y a plusieurs manières de procéder pour installer un module Perl. La première consiste à regarder, si il n&#8217;est pas déjà packagé pour votre distribution. Si vous êtes sous Debian ou un dérivé, vous devriez trouver la plupart du temps votre bonheur, étant donné la grande facilité de packager un module Perl pour cette [...]]]></description>
			<content:encoded><![CDATA[<p>Il y a plusieurs manières de procéder pour installer un module Perl. La première consiste à regarder, si il n&#8217;est pas déjà packagé pour votre distribution. Si vous êtes sous Debian ou un dérivé, vous devriez trouver la plupart du temps votre bonheur, étant donné la grande facilité de packager un module Perl pour cette dernière distribution. La paquet d&#8217;un module Perl pour Debian, généralement, se trouve de la forme libtype-nom-perl. Par exemple :<br />
libnet-twitter-perl<br />
ou encore<br />
libarchive-tar-perl</p>
<p>C&#8217;est la méthode à préconiser pour une intégration parfaite à votre distribution. </p>
<p>Il peut arriver tout de même, qu&#8217;il n&#8217;existe pas de paquet pour le module que vous souhaitez installer, dans ce cas là, vous pouvez passer par le CPAN.<sup>1</sup> Le module CPAN.pm a été préinstallé sur votre machine. Il va vous permettre d&#8217;installer et configurer des modules. Lors du première appel à cpan, il vous faudra répondre à une série de questions, notamment le chemin de gunzip. Généralement les réponses par défaut sont correctes, mais tâchez tout de même, à toujours  vérifier, c&#8217;est important de faire attention à ce que l&#8217;on fait. Ensuite vous pourrez installer des modules via le cpan, soit en lançant la commande cpan, et ensuite au prompt cpan indiquez install suivi du nom du module :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code70'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35070"><td class="code" id="p350code70"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">install</span> Net::Twitter</pre></td></tr></table></div>

<p>Soit en indiquant en argument le module à installer :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code71'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35071"><td class="code" id="p350code71"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> cpan Net::Twitter</pre></td></tr></table></div>

<p>La dernière solution consiste à installer le module à la main, notamment lorsque le module n&#8217;est pas disponible sur le CPAN. Il vous faudra alors récupérer les sources généralement compressées au format tar.gz. Ensuite décompressez l&#8217;archive, déplacez-vous dans le répertoire, lisez le README, pour finir effectuez les manipulations qui sont généralement <strong>perl Makefile.pl</strong> qui va générer le makefile, <strong>make</strong>, <strong>make test</strong> et enfin <strong>sudo make install</strong>.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code72'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35072"><td class="code" id="p350code72"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>search.cpan.org<span style="color: #000000; font-weight: bold;">/</span>CPAN<span style="color: #000000; font-weight: bold;">/</span>authors<span style="color: #000000; font-weight: bold;">/</span>id<span style="color: #000000; font-weight: bold;">/</span>M<span style="color: #000000; font-weight: bold;">/</span>MM<span style="color: #000000; font-weight: bold;">/</span>MMIMS<span style="color: #000000; font-weight: bold;">/</span>Net-Twitter-<span style="color: #000000;">3.05000</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> Net-Twitter-<span style="color: #000000;">3.05000</span>.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> Net-Twitter-<span style="color: #000000;">3.05000</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #7a0874; font-weight: bold;">test</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>  <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>Si tout s&#8217;est passé et que vous n&#8217;avez pas eu de message d&#8217;erreur le module devrait être installé. J&#8217;ai pris un mauvaise exemple, mais je n&#8217;avais pas de module non disponible sur le CPAN sous la main. C&#8217;était pour montrer la démarche. Pour vérifier que le module est bien installé :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code73'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35073"><td class="code" id="p350code73"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> -MNet::Twitter <span style="color: #660033;">-e</span> <span style="color: #000000;">1</span></pre></td></tr></table></div>

<p>Si aucun message ne s&#8217;affiche, cela signifie que le module est bien installé.</p>
<p>En revanche, si vous avez ce genre de message :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code74'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35074"><td class="code" id="p350code74"><pre class="bash" style="font-family:monospace;">Can<span style="color: #ff0000;">'t locate Net/Twitter.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .).</span></pre></td></tr></table></div>

<p>C&#8217;est qu&#8217;il y a eu un problème quelque part. </p>
<p>Concernant les bibliothèques que vous être en train de développer ou qu&#8217;un ami vous a gentiment fourni et que vous aimeriez tester. Vous pourrez créer un répertoire lib/perl par exemple, dans votre home personnel et indiquer le chemin à la variable d&#8217;environnement PERL5LIB :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code75'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35075"><td class="code" id="p350code75"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PERL5LIB</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/lib/perl&quot;</span></pre></td></tr></table></div>

<p>Une autre solution consiste à indiquer le chemin directement dans le source :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p350code76'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p35076"><td class="code" id="p350code76"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> lib <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'HOME'</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;/lib/perl&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Voilà, vous êtes maintenant paré à installer des modules Perl de différentes manières. N&#8217;oubliez pas, Perl, c&#8217;est bien et ce qui fait sa grande force est justement son nombre de bibliothèques disponibles sur le CPAN. </p>
<ol class="footnotes"><li id="footnote_0_350" class="footnote"> Comprehensive Perl Archive Network qui regroupe la plupart des archives logicielles et bibliothèques écrites en Perl. </li></ol>]]></content:encoded>
			<wfw:commentRss>http://hobbestigrou.interface-c.com/installer-un-module-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
