in reply to How to add functions to an existing module?

Consider file noname1.pm containing:

use strict; use warnings; package noname1; sub new { return bless {}; } 1;

and noname1.pl containing:

use strict; use warnings; use noname1; package noname1; sub doit { print "Hello world\n"; } package main; my $obj = noname1->new (); $obj->doit ();

Executing noname1.pl prints:

Hello world

DWIM is Perl's answer to Gödel