Rewrite to Perl

Signed-off-by: Alexander Kluth <kluth@freshcells.de>
cpan

Signed-off-by: Alexander Kluth <kluth@freshcells.de>
From C++ to Perl

Signed-off-by: Alexander Kluth <kluth@freshcells.de>