[KPUG] Write an MP3 library engine

Gryphon Shafer gryphon at gryphonshafer.com
Tue Sep 25 10:38:56 PDT 2012


Greetings all,

For folks who are getting toward the end of Learning Perl and have a 
comfortable level of vi (since it takes months to be a power vi user), 
here's the next step: Write an MP3 library engine.

One of the great power features of Perl is that 90% of most programs 
have already been written. What I mean by that is that most of the 
complexity in most programs has already been written in the form of code 
libraries, which are hosted on CPAN (the Comprehensive Perl Archive 
Network). When beginning any Perl program, it's useful to check CPAN 
(search.cpan.org) for libraries that will help.

Installing CPAN libraries on your VM is fairly straight forward, but can 
be made even easier by installing "cpanminus". Here's how you do that:

cpan -i App::cpanminus

Read more about what cpanminus is here:
http://search.cpan.org/~miyagawa/App-cpanminus-1.5018/lib/App/cpanminus.pm

With that done, do a search on CPAN for "MP3", and you'll get a lengthy 
list of libraries of various value. Keep in mind that while CPAN is 
awesome, most of the code on CPAN isn't. It's just that the 10% of CPAN 
that isn't horrible is extremely helpful and powerful. Take a look at 
module ratings (the stars) to learn what the community thinks of some 
modules.

Your mission, should you choose to accept it, is to build an MP3 library 
engine. Grab some MP3s and throw them into a directory structure. You 
can organize them however you'd like, just as long as they're in a 
directory structure of some kind. Then write a Perl program that will 
read through all the files and build an index of their titles, artists, 
lengths, and whatever else you find interesting. Present a command-line 
interface that will allow a user running your program to search for MP3s 
based on title (including wildcard searching), artists, lengths, and so 
forth.

While you're doing this, here is a helpful resource with a lot of 
examples of how to solve problems that you might encounter along the way:
http://goldenguru.com/docman/OReilly/Perl_Bookshelf_v4/cook/index.htm

Good luck.

Gryphon


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kpug-pm/attachments/20120925/d6aef347/attachment.html>


More information about the KPUG-PM mailing list