Random Futurama

Dec 11, 2007

I like Futurama. All of it. Though I occasionally have a hankering for a specific episode, I often just want /any/ episode, so I wrote a quick Perl script to play one at random. I have a directory filled with all of Futurama, so this is an easy proposition:

#!/usr/bin/perl
use strict;
use warnings;

my @files = split /\n/, `ls *avi`;

my $num = rand(scalar(@files));

system "mplayer "$files[$num]"";