my $sub = 'integer1'; my $space = '.' x 25; my ($int,$erwartet); foreach my $test ( .57 * 100,'=57', .58,'=0', 12.345,'=12', 57.00000000000000001,'=57', 0.000000000000001,'=0', 1.01205,'=1', -0.903,'=0', -1.999999999999999,'=-1' ) { if (substr ($test,0,1) eq '=') { $erwartet = substr ($test,1); print " " . ($int eq $erwartet ? ' OK' : " FEHLER! Erwartet \'$erwartet\'") . "\n"; } else { $int = &{$sub} ($test); print "\'$test\'" . substr ($space,0,25 - length ($test)) . "geINTet: \'$int\'" . substr ($space,0,25 - length ($int)); } }