my $obj = myClass->new(); while ( ... ) { $obj->reset(); $obj->otherMethods(); .... } $obj->cleanup(); #Instead of while( ... ) { my $obj = myClass-otherMethods(); }