in reply to writing to a log file....

Check also if you get an error with $! when opening LOG:
open( LOG, ">> huntlog.log") || die("Could not open log file: $!");