Perl CGI.pm and Unicode

Because I always forget how to handle Unicode input/output in Perl .. a few notes to help jog my memory for next time: Remember to use both CGI.pm and Encode.pm: use CGI qw(:standard); use Encode qw(decode encode); Handle webform input with Unicode characters: my $input = decode(‘utf8’, param(‘input’)); Prepare scalar variables to cope with Unicode … Read more

SpamAssassin sa-learn cron script for virtual users

Because I couldn’t find something to fully automate the SpamAssassin sa-learn process for virtual email users in a MySQL database, I wrote my own (borrowing liberally from Jason Schaefer’s SpamAssassin training and spam cleanup script). This script assumes that: You have a MySQL database with virtual users, with a user table called ‘virtual_users’ and the … Read more