For a first script, this is a mighty fine effort. A few more points worth pointing out, but they are minor niggles:
- At open (TEXTFILE,"$path_to_text"), when you have a variable interpolated into a string, and nothing else, just use the variable (e.g. $path_to_text instead of "$path_to_text"). Although I realise this could well just be an artifact of the development process.
- The initialisation of $words is more idiomatically performed using the || short-circuit operator thusly:
my $words = $q->param(words) || 'no specials today'
- Sending mail can be performed by perl, rather than spawning an external program. Options include Mail::Mailer, Net::SMTP or my favourite Mail::Sendmail (that, despite its misleading name, does not require sendmail (nor Unix, for that matter)).
- Point of order on your HTML, <font color = blue> is better written as <font color="blue">. You can use a heredoc or the qq{} operator to avoid having to escape out the embedded "s in your string.
--g r i n d e r