2012/03/27

JS Fiddle

http://jsfiddle.net/n6ZPa/

2012/03/26

Search @INC

perldoc -l My::Module

perl -e 'print join " ", @INC, "-name Simple.pm"' | xargs find

perl -e 'print join " ", @INC, "-wholename *Some/Simple.pm"' | xargs find

for inc in $(perl -e 'print join " ", @INC');
do
find $inc -name Simple.pm;
# or: find $inc -wholename *Some/Simple.pm;
done

2012/03/21

Remove dot files

# removes temporary files starting with '.' (excludes '.' '..')
ls -d .* | grep -v '^.svn$' | grep -v '^.$' | grep -v '^..$' | xargs rm
# or
rm -r * && rm .*

2012/03/20

local::lib

Install local::lib:

http://search.cpan.org/search?query=local%3A%3Alib&mode=all
tar xzf local-lib-1.003003.tar.gz
cd local-lib-1.003003/
perl Makefile.PL --bootstrap
make test && make install

or:

sudo apt-get install liblocal-lib-perl

Append to .bashrc:
echo '[ $SHLVL -eq 1 ] && eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >>~/.bashrc

Re-read configuration file:
. ~/.bashrc

Install cpanm:
cpan App::cpanminus

or:

sudo apt-get install cpanminus
Install module:
cpanm Acme::EyeDrops

Now it should appear in ~/perl5/lib/perl5

=================
$ cpan
<cpan[1]> o conf init urllist
# follow the prompts to pick a cpan mirror near you
<cpan[2]> o conf commit
<cpan> exit

o conf prerequisites_policy follow
o conf build_requires_install_policy yes
o conf make_install_make_command 'sudo make'
o conf commit