Created
December 16, 2011 07:05
-
-
Save keedi/1484896 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.14.1; | |
use charnames ':full'; | |
binmode(STDOUT, 'encoding(utf-8)'); | |
my $i = 0; | |
my %digit = map { $i++ => $_ } | |
qw(ZERO ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE); | |
my $str = $ARGV[0] || die "usage: bold 'string to bold-ify'\n"; | |
$str =~ s<([a-z0-9])>< | |
my $name = $1 ge 'a' && $1 le 'z' ? "MATHEMATICAL BOLD SMALL \U$1" | |
: $1 ge 'A' && $1 le 'Z' ? "MATHEMATICAL BOLD CAPITAL $1" | |
: $1 ge '0' && $1 le '9' ? "MATHEMATICAL BOLD DIGIT $digit{$1}" | |
: undef; | |
$name ? charnames::string_vianame($name) : $1; | |
>gei; | |
say $str; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment