#!/usr/bin/perl -w ##################################################### # Script: mp3_average_year # Author: Jeff Anderson # Date: 03/15/2001 # Comments: finds average year of my mp3 collection ##################################################### use strict; use File::Find; use MP3::Info; my ($sum,$count); my $start = shift || '/mnt/lump/mp3'; find sub { if (/mp3$/) { my $tag = get_mp3tag($_); my $year = $tag->{'YEAR'}; next unless $year =~ /^\d+$/; next unless ($year > 1950 and $year < 2002); $sum += $year; $count++; } }, $start; print "$sum / $count = " . $sum / $count . "\n"; |
UPDATE:
Oh yeah, _PLEASE_ don't actually do what i just did and
actually post gvim rendered HTML, as the resulting HTML
increases in size tenfold. Guess that makes me a
hypnotist.
jeffa
i liked it better than cats, i will use gvim again and again ...
In reply to (jeffa) 2Re: Comments in my code (gvim syntax highlighting example)
by jeffa
in thread Comments in my code
by s0ttle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |