Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
667 B

#!/usr/bin/env perl
# decorate text by randomizing single characters inside of
# <p class="centerpiece"></p> to different unicode bullety
# things
# i have no idea what is going on here
use utf8;
use open ':std', ':encoding(UTF-8)';
use strict;
use warnings;
use 5.12.0;
my @bullets = qw(
☆ ✢ ✣ ✤ ✥ ✦ ✧ ✩ ✪ ✴ ✵ ✶ ✨ ✮ ✯ ✺ ✾ ❦ ☙ ❂ ❃ ❉ ✿ ❀ ❁ ☼
);
# you could always swap these in for bullets if you wanted
# an especially wintery effect:
my @snowflakes = qw(
❄ ❅ ❆
);
while (<>) {
s{(->|<p class="?centerpiece"?>)[ ]?(.)[ ]?(<-|</p>)}{
"$1 " . $bullets[rand @bullets] . " $3"
}eg;
print;
}