Skip to content

Instantly share code, notes, and snippets.

@keedi
Created December 16, 2011 07:05
Show Gist options
  • Save keedi/1484896 to your computer and use it in GitHub Desktop.
Save keedi/1484896 to your computer and use it in GitHub Desktop.
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