There is a file named \*.iso, where `*` is any string (dot, numbers, alphabets, spl characters).

\*.iso is located at /dm2/www/html/isos/preFCS5.3/ 

I want to get this filename into $filename. I know it's very simple. How can I do this in Perl?
['https://Stackoverflow.com/questions/6856491', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/713200/']
This can be solved at `TObject`'s level. Its destructor has to be virtual:

```
#include <Classes.hpp>
class TObject 
{
   __fastcall TObject();
   virtual __fastcall ~TObject(); 
};

```

This way you can either do:

```
TObject * pobj = new TMyObject();
delete pobj;

```

or

```
TMyObject * pobj = new TMyObject();
delete pobj;

```

Both destructors will be called (`~TMyObject()` first and then `~TObject()`) and you will have no leak.
If you destroy a `TMyObject` through a reference of type `TMyObject` you don't have to do anything. In case you have a pointer/reference of type `TObject` to a `TMyObject` things will go wrong. *Only* the `TObject` destructor will be called, not the `TMyObject` one:

```
TObject* p = new TMyObject;
delete p; // Only the TObject::~TObject is called, not TMyObject::~TMyObject.

```

To have the decision on what destructor to call deferred to runtime, you need to specify the destructor as `virtual` in `TObject`. Whenever you have a class that is intended to be derived from, the destructor should be virtual. Otherwise there is always a risk for resource leaks when the derived class destructor isn't called properly.