#!/usr/bin/perl use warnings; use strict; package Foo; sub new { return bless {},shift; } sub hello { print "hello"; } package main; sub new { print "haha"; return; } my $a = new Foo; $a->hello; __END__ C:\test>junk2 hello