MP3::M3U - m3u playlist parser
use MP3::M3U; my $m3u = new MP3::M3U '/path/to/playlist.m3u'; my $files = $m3u->parse(); print foreach @$files;
The parser engine tries to be smart in that it tests the existence of each file in the playlist with fallbacks. That is, if a file in the playlist doesn't exist, the engine will prepend the root path of the playlist to the filename. This is useful when the m3u is in the format of: \song1.mp3 \song2.mp3
The second fallback is specified via the parse method. See below.
First argument is the absolute path to the playlist filename.
The optional arguments specify the search and replace strings to be executed for each filename in the playlist.
eg.:
GIVEN: playlist.m3u: E:\song1.mp3 E:\song2.mp3
WANTED: /mp3/songs/song1.mp3 /mp3/songs/song2.mp3
SOLUTION: parse('E:', '/mp3/songs');
Ilia Lobsanov <ilia@lobsanov.com>
Copyright (c) 2001 Ilia Lobsanov, Nurey Networks Inc.
Licensed under GPL.
To install MP3::M3U, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MP3::M3U
CPAN shell
perl -MCPAN -e shell install MP3::M3U
For more information on module installation, please visit the detailed CPAN module installation guide.