programming-examples/perl/SystemFunction/Soundex function.pl

12 lines
221 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
use warnings;
use strict;
use Text::Soundex;
while (<>) {
chomp; #remove trailing linefeed
s/\W/ /g; #zap punctuation, e.g. '.', '@'
print "'$_' => '@{[soundex(split)]}'\n";
}