I have Class A with following constructor:
sub new {
my ($class, %args) = @_;
return bless(\%args, $class);
}
I have another class, LWP::UserAgent, which I want to use in my Class A. I could solve the problem by doing this:
ua = LWP::UserAgent->new;
sub new {
my ($class, %args) = @_;
return bless(\%args, $class);
}
But in this case I will have 1 object of UserAgent, but I want a unique object for each instance of my Class A.