in reply to Recreating an object from its own method

As mentioned above, you could assign to $_[0], but you can still get into trouble with this if your object reference is copied anywhere - then you would get 2 different objects, and the code you are using might get confused somewhere.

For this reason, and as a matter of clarity, I think I would actually prefer my $agent = $agent->previous if you really need to create a new object.

I do however wonder if in this case it would not be more efficient and clearer if you could just update the state of the object without creating a new one...

-- Joost downtime n. The period during which a system is error-free and immune from user input.