Skip to content

Instantly share code, notes, and snippets.

@ispedals
Created May 20, 2013 21:49
Show Gist options
  • Select an option

  • Save ispedals/5615858 to your computer and use it in GitHub Desktop.

Select an option

Save ispedals/5615858 to your computer and use it in GitHub Desktop.
Display the character name of farsi letters in a sentence
#!perl
use v5.12;
use strict;
use warnings;
use utf8;
use Unicode::UCD 'charinfo';
my $SENTENCE = '';
foreach (split(' ',$SENTENCE)){
foreach (split('')){
my $letter=charinfo(ord($_))->{'name'};
$letter =~ s/^arabic letter( farsi)?\s*//i;
print "|$letter";
}
print "\n";
say '-' x 50;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment