#!/usr/bin/perl use utf8; use charnames ':full'; while ($line=<>){ @array = split(/ /, $line); foreach $x (@array){ if ($x=~ /\N{LATIN SMALL LETTER K}/){ #full character name for a 'k' print "$x\n"; } } }