Raspberry Pi, Perl, and SortTV

When you have a lot of video files you want to rename in an organized fashion, the best way is to use SortTV. It’s a Perl script that renames files according to settings you customize in a configuration file, and it’s quite powerful. It uses the TV DB and The Movie Database, and it can parse filenames based on period and comma delimited entries.

I’ve had to install Perl several times now, and it’s always been this whole ordeal because of different processors and dependencies. There are a lot of resources out there, but I keep forgetting them. Here are some of the main ones that should get you by.

On RaspBMC, the Debian package management helps a lot.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential

CPAN or CPAN Minus? CPAN comes with Perl, but CPAN Minus is an attempt at a zero-configuration method of installing Perl modules.

To enter the CPAN shell:

sudo perl -MCPAN -e shell

Some key installs before rushing forward:

sudo cpan Bundle::CPAN App::cpanminus

perl-5.18.1 is necessary for its version of File::Glob, one of SortTV’s dependencies. That’s why you need perlbrew (documentation), which is the easiest way to install multiple versions of perl. It also doesn’t interfere with your system version of Perl, so it’s not going to mess things up when you upgrade your OS.

sudo cpanm App::perlbrew
perlbrew init

If, for whatever reason, perlbrew isn’t doing its job, here are some instructions on the installing it manually; the Linux section is at the bottom.


Christian. Audio. Technology. Go-Getter. Concise.

Posted in Hacks, Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s