Search this blog

vendredi 11 février 2011

Configuring CPAN.pm for installation in user directory

Installation using local::lib
  • Go to http://search.cpan.org/dist/local-lib to check the URL of the last version of local::lib
  • execute the following commands for a new CPAN installation (e.g. delete before .cpan directory if you don't care about already installed modules):
cd
wget http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz
gunzip local-lib-1.008004.tar.gz
tar -xf local-lib-1.008004.tar
cd local-lib-1.008004
perl Makefile.PL --bootstrap
make test
make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
source ~/.bashrc
perl -MCPAN -eshell
o conf prerequisites_policy follow
o conf build_requires_install_policy yes
o conf commit
exit
 Then, try to install a module such as:
perl -MCPAN -e 'install XML::XQL'
perl -MCPAN -e 'install CGI::Ajax'
perl -MCPAN -e 'install Text::NSP::Measures::2D::Fisher'
See for more details: http://perl.jonallen.info/writing/articles/install-perl-modules-without-root

lundi 7 février 2011

Emacs: commenter plusieurs lignes / comment several lines

FR: M-x correspond à appuyer sur echap puis sur x et ensuite on tappe la suite...pour aller plus vite ou voir les autres commandes possible, on peut tapper M-x puis c puis sur tab (mécanisme de complétion qui élimine tout ce qui ne correspond pas à "c" et affiche le reste). Pour info, pour "décommenter", il faut utiliser "uncomment-region"
M-x comment-region
M-x uncomment-region

EN: M-x means press the ESC key then x key. Type the commands below to comment or uncomment a region of code:
M-x comment-region
M-x uncomment-region


Source: http://www.developpez.net/forums/d11811/autres-langages/perl/langage/langage-mettre-plusieurs-lignes-commentaire/


vendredi 4 février 2011

Linux: GREP recursif / recursive GREP

Combiner grep et find pour chercher une chaine de caractère dans les fichiers texte d'un dossier de façon récursive:
find . -type f -name \*.html -print | xargs grep "Texte à chercher"

Combine grep and find to search recursively text files in a folder for a text string:
find . -type f -name \*.html -print | xargs grep "Text to search"