#! /usr/bin/perl use warnings; use strict; package ABCconf; sub Query { my( $package ) = caller; print "Query called from $package\n"; my $x = ABCconf::Query->new(); } sub Insert { print "Insert called\n"; my $x = ABCconf::Query->new(); # <= problem: calls ABCconf::Query and then on its output ->new } # Insert package ABCconf::Query; sub new { my $class = shift; print "New called: $class\n"; return bless {}, $class; } # new package main; ABCconf::Query(); print "-" x 60, "\n"; ABCconf::Insert();