in reply to skip blank lines that may contain from time to time some ";"

...and then there was some ";" instead of the blank lines.

You mean like this?

... -0.701399;44.840355 ; RWY_protection_2;80 ...

Then why not simply remove it before doing the other processing?

$line =~ s/^\s*;\s*$//;