
| Current Path : /var/www/web-klick.de/dsh/50_dev2017/1300__perllib/Utility/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/50_dev2017/1300__perllib/Utility/TextChanger.pm |
package Utility::TextChanger;
use strict;
sub new {
my $class = shift;
my $self = {};
bless($self,$class);
return($self);
}
sub tt {
my $self = shift;
my $text = shift;
my $o; my $o1; my $o7;
$text =~ s/\[([A-Z]+)\]/\[\+\$$1,0\+\]/sg;
$text =~ s/\[([A-Z]+)([0-9])\]/\[\+\$$1,$2\+\]/sg;
while ($text =~ s/\[([\+\-])(.*?)[\+\-]\]/---VAR---/s) {
$o7 = $1;
$o = $2;
$o1 = "f";
if ($o =~ /(.*),(.*)/) {
$o1 = $2;
$o = $1;
}
$o = eval($o);
if ($o7 eq "-") {
$o = "";
}
if ($o1 eq "f") {
1;
}
else {
$o = sprintf("%" . sprintf("%1.0f",$o1+1) .
"." . sprintf("%1.0f",$o1) . "f", $o);
}
$text =~ s/---VAR---/$o/;
}
return($text);
}
#**********************************************************************
1;