in reply to scalar number with preceding 0.

Does $h already have a space? When you post sample code, you should include input as well as output. I would print this after assigning the variables to check what's in the variables (update: from a console or into a file, not into a browser from a cgi script):
print "[$h][$m][$s]\n";
Also check what's in the variables after any time you modify them. As others have mentioned, zeroes don't just magically become spaces.