# look up the grand totals counter $counter_file = "gtct.txt"; open (FILE, "<" . $counter_file); $count = ; close (FILE); chomp $count; { my $cc = $count; $cc = substr ("0000000".$cc, -8, 8); foreach $x (0..7) { $cs = substr($cc, $x, 1); print "\"$cs\"" } }