¡Feliz Navidad!

use Term::ANSIColor;

my $message = pack("H*", "4D65727279204368726973746D61732066726F6D204861636B706C6179657273");
my $color1 = "green";
my $color2 = "red";
my @tree = (
"         *",
"        ***",
"       *****",
"      *******",
"     *********",
"        ***",
"        ***",
"        ***"
);
for (my $i = 0; $i < 5; $i++) {
  print "\033c";
  foreach my $line (@tree) {
    if ($i % 2 == 0) {
      $line =~ s/\*/O/g;
    } else {
      $line =~ s/O/\*/g;
    }
    if ($i % 2 == 0) {
      print color($color1) . "$line\n" . color("reset");
    } else {
      print color($color2) . "$line\n" . color("reset");
    }
  }
  print "$message\n";
  select(undef, undef, undef, 0.5);
}

 Ho ho ho! 2013 2014 2015 2016 2017 2018 2019 2020 2021...

Comentarios