in reply to When I try to create different objects i end up getting the same one over and over...

You may want to use strict; inside the code for VRTSAgent (after package VRTSAgent;). It looks like you're using several undeclared variables, and this may help you catch some errors.

Another thing I notice right off the bat is these two lines:

$agents[++$j]= new VRTSAgent; $agents[$j]->new();
The first statement calls new(), so there's no need to call it again. In fact, when you do call it the second time, you're passing a VRTSAgent object as the first parameter rather than the name of a class, as your new() expects.
  • Comment on Re: When I try to create different objects i end up getting the same one over and over...
  • Download Code