#More code is here, this is just to explain my problem... $sth->execute() || die $sth->errstr; while (my $pointer = $sth->fetchrow_hashref){ $N_NUM = &cleaner ($pointer->{'number'}); push @array,$N_NUM; &total(@array); #Print HTML print "
| Products | "; # My problem is here cause I can only get the value of this varialbe $results when I have send the array @array to the SUB TOTAL &total; print "$results |