#!/usr/bin/perl -l package Example::Module; use overload '""' => sub { ref shift }; sub new { bless [ $_[1] || "default" ], shift; } sub Example::Module { return Example::Module::->new(@_); } sub print_it { print $_[0]->[0]; } package main; $a = Example::Module(); $a->print_it; $b = Example::Module("b"); $b->print_it; __END__ default b