in reply to simple question

use the chomp function to get rid of the new line characters that are hidden.
chomp($yr); chomp($mm); chomp($dd);