How do I remove the `.` character(s) that start in the beginning of each number or end on each number?

Remark – `perl` one liner also good alternative for `sed`.

Example input:

```
 .23.12.44.5.
 .233.3.3.3
 23.4.5.3.2..
 ....33.2.3.45.5
 .3.3.2.....

```

Expected output:

```
 23.12.44.5
 233.3.3.3
 23.4.5.3.2
 33.2.3.45.5
 3.3.2

```

(note that the lines may end and/or begin with blanks (spaces or tabs) which should be preserved).