Thursday, December 30, 2010

Ideone -- an online pastebin and compiler in one

http://www.ideone.com/

What is ideone?
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows
to compile and run code online in more than 40 programming languages.


Sounds cool, I wonder if I will find a cool use for it sometime soon?

Thursday, December 9, 2010

Perl -- add the script's directory to @INC

Lets say you write a Perl script that includes some local packages, but you want to run the script from a symlink or from in your path. How can you get it to include those packages in your libraries (@INC)?

Near the top of your script place the lines:


use Cwd 'abs_path';
use File::Basename;
use lib dirname( abs_path $0 );


Should work in all cases and on all OSes. (source: http://use.perl.org/~Aristotle/journal/33995)