do { my $tmp = new FooMatic::Object(); $tmp->enter(); # benutzercode $tmp->leave(); }