CPAN comes with an MP3::Tag module, which provides ready-made tools to read and extract metadata from MP3 files, making it a simple matter to identify the title, artist, and genre of a particular MP3 track. Here is some example code showing how you can use the module to create a categorizing application.