I highly recommend
Log::Log4perl. Combined with
Log::Dispatch::FileRotate you have a very powerful logging mechanism that will write your error messages to file.
--
print map{chr}unpack(q{A3}x24,q{074117115116032097110111116104101114032080101114108032104097099107101114})