#!/usr/bin/perl use 5.008; use strict; use warnings; use locale ':not_characters'; my @words = ( 'ルイビトン!', 'ルイビトン', 'V1$gRa!', 'Viagra', 'интернет!', 'товары', ); while (my $line = ) { for my $spamword (sort @words) { print ($line =~ /\b\Q$spamword\E\b/i ? "Spam: $spamword -> $line" : ''); } } __END__ __DATA__ CAT & CATZE ルイビトン ルイビトン! 8I_Iy ViAGra! Test.Toast интернет! Perl's son is not Tim Towdy!