in reply to Age of dir in UNIX

You are calling stat in scalar context. As documented, it only returns success/failure, not the list. Possible fix: take directly the field you are interested in.
my $LastModified = (stat $InputDir)[9];
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ