But Perl is not a strongly-typed language. You can also use
to ensure that $year is interpreted as a number in following
statements (as long as the following statements don't do
anything to the variable).
However, the code you show should make year a number in any
case. Perhaps the code actually is
or is otherwise assigned a value interpreted as a string.