perl program for diaries with tags