modulino

In Perl, how can I find out if my file is being used as a module or run as a script?

Let's say I have a Perl file in which there are parts I need to run only when I'm called as a script. I remember reading sometime back about including those parts in a main() method and doing a main() unless(<some condition which tests if I'm being used as a module>); But I forgot what the condition was. Searching Google hasn't turned...

How to include unit tests in a ruby module ?

I'm trying to include the unit tests for a module in the same source file as the module itself, following the Perl modulino model. #! /usr/bin/env ruby require 'test/unit' module Modulino def modulino_function return 0 end end class ModulinoTest < Test::Unit::TestCase include Modulino def test_modulino_functio...