in reply to how can print the variable values

Well, one of doing this (although I strongly recommend against this practise - not just this way, but using "names of variables" to get to the variables value in general) is:
use warnings; use strict; our $KPI0 = 10; our $KPI1 = 20; our $KPI2 = 30; our $KPI3 = 40; our $KPI4 = 50; for (my $i = 0; $i < 5; $i++) { my $var = "KPI$i"; no strict 'refs'; print "line", $$var, "\n"; }
But I can't imagine why you want it this way. Use an array or a hash:
use strict; use warnings; my @KPI = (10, 20, 30, 40, 50); for (my $i = 0; $i < @KPI; $i++) { print "line", $KPI[$i], "\n"; }