Disconnection seems to be handled via destructors. Perl uses special DESTROY
methods for this. It is not advisable to call this method manually.
You need to decrease the refcount of your $mech
object in order to get it destroyed automatically. This happens when the variable drops out of scope, in the Global Destruction Phase at the end of the process, or (in the case of objects), by assigning something different to your variable, e.g.
$mech = undef;
To completely deallocate any variable, you can also
undef $mech; # which btw is the answer provided in the FAQ you linked
The differences are subtle, and irrelevant in this case.