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; }