#!/usr/bin/perl use strict; use warnings; use MP3::M3U::Parser; # use Data::Dumper; print "Read MP3 Test file \n"; my $parser = MP3::M3U::Parser->new(-seconds => 'mm:ss'); $parser->parse("/home/rgammon51/Documents/Playlist.m3u")->export (-ove +rwrite => 1); my $result = $parser->result; my %info = $parser->info; printf "Number of Songs in this list :: %s\n ", $info{songs}; printf "Total Time to play all songs :: %s\n ", $info{ttime}; printf "Average Time of all songs :: %s\n ", $info{average};

This ending part does not generate mm:ss results The formatted time only appears in the html file.

My goal, ultimately, is to use this module to generate a shell script to update the contents of my mp3 player that I carry around daily. it is a cheap player that does not implement shuffle, so I must update its contents periodically with new material, and most importantly in a different order.

This code uses your hint as to how to proceed. however, the screen output from printf is just seconds, not hh:mm:ss.

This appears to be a characteristic of the code in the CPAN module, and to change it, I must modify the source.


In reply to Re^2: CPAN module MP3::M3U::Parser question by rgammon51
in thread CPAN module MP3::M3U::Parser question by rgammon51

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.