I come from a shell background so I don't agree with your comments on the file tests, although I understand that they can be ambiguous. If there is an aspect to a language that you find difficult, how about commenting the code until you are comfortable with the operations you are performing?
i.e.
# Get the age of the file
my $age = -M BASE_DIR."/$state/$_";
CC
Update: Fix the comment...