use warnings; use strict; my @emoticons = ('fred::there:::P', 'fred::there::*tounge*'); while (my $line = ) { my ($username, $message, $date, $ip) = split(//, $line); foreach my $emoticon (@emoticons) { my ($name, $location, $face) = split(/::/, $emoticon); $message =~ s|(? |gi; } if ($message =~ m|^/me|i) { $message =~ s|^/me||i; print qq($username $message
); } else { print qq($username: $message
); } } __DATA__ success!

test*yawn* test *yawn*Mon Oct 31 15:15:12 200524.118.232.47 test*yawn* test *yawn*Mon Oct 31 15:07:12 200524.118.232.47 testhi there :)Mon Oct 31 14:48:59 200524.118.232.47 adminhi :PMon Oct 31 14:37:51 200524.118.232.47 admin **** headMon Oct 31 10:01:33 200524.118.232.47 admin/me testMon Oct 31 08:57:39 200524.118.232.47 test **** monkeyMon Oct 31 08:39:54 200524.118.232.47 test **** monkeyMon Oct 31 08:20:22 200524.118.232.47 swear test **** you **** holeSun Oct 30 12:06:50 200524.118.232.47 #### success!

test: *yawn* test *yawn*
test: *yawn* test *yawn*
test: hi there :)
admin: hi fred
admin: **** head
admin test
test: **** monkey
test: **** monkey
swear test: **** you **** hole