package Utils::Agent; sub SetDestination { my $self = shift; my $class = shift; my $construct = "\$".$class; # i have lot of destination in different packages # so i can't say every time $pkg::destination $Destination = $construct::destination; return $Destination; } #### use Utils::Agent; use Data::Config; use Web::Config; my $config = new Data::Config; my $webConfig = new Web::Config; my $utils = new Utils::Agent; $utils->SetDestination(ref($config));