Or, in this trivial case, get rid of $an1 and $an2 and use 1 and 2.
I prefer Readonly over constant, because Readonly just makes the variables readonly, with no surprises, whereas constant (ab)uses the perl optimizer and implements the constants as functions returning a constant value. This has some nasty side effects documented in Readonly.
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)