View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Olof Johansson > Parse-M3U-Extended-0.1 > Parse::M3U::Extended



Annotate this POD

View/Report Bugs
Module Version: 0.1   Source   Latest Release: Parse-M3U-Extended-0.3


Parse::M3U::Extended - a simple Regexp::Grammars based M3UE parser


 use LWP::Simple;
 use Parse::M3U::Extended qw(m3u_parser);

 my $m3u = get("");
 my @items = m3u_parser($m3u);


This module contains a simple parser for the Extended M3U format as used in e.g. HTTP Live Streaming. It also supports the regular M3U format, usually found with digital copies of music albums etc.



Takes a m3u playlist as a string and returns a list, with each element is a hashref with the keys type and value. If the playlist's first line is "#EXTM3U\n", then the elements in the returned list can have type "directive", which has a "tag" key and the value key is optional.

   type => 'comment',
   value => 'a comment',

   type => 'item',
   value => '',

   type => 'directive',
   tag => 'EXTM3U',

   type => 'directive',
   tag => 'EXT-X-ALLOW-CACHE',
   value => 'YES',

Internally, it's using Regexp::Grammars, and the returned result hash is then flattned. If you want to work with the result hash, you can use $Parse::M3U::Extended::parser directly, but documenting its structure is outside the scope of this manual. Please refer to Regexp::Grammars.

If the playlist supplied does not match an M3U file, undef is returned.



Copyright (c) 2012 - Olof Johansson <> All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: