in reply to help need with flexlm
Have a look at this node: Splitting a file into records. Solutions proposed there can be easily adapted for your problem. Proposals how to send emails are all over PerlMonks...