|
|
- #!/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;
- }
|