Audio-DB

 view release on metacpan or  search on metacpan

bin/genre_statistics.PLS  view on Meta::CPAN

  
  # Album breakdown by genre
  print "ALBUM BREAKDOWN BY GENRE\n";
  foreach (sort { $a->genre cmp $b->genre } @genres) {
    print $_->genre,"\n";
    foreach (sort {$a->album cmp $b->album } @{$_->{albums}}) {
      print "\t",$_->album,"\n";
    }
  }
}


# Artist breakdown by genre
print "ARTIST BREAKDOWN BY GENRE\n";
foreach (sort { $a->genre cmp $b->genre } @genres) {
  print $_->genre,"\n";
  foreach (sort { $a->artist cmp $b->artist } @{$_->{artists}}) {
    print "\t",$_->artist,"\n";
  }
}

__END__

=pod

=head1 NAME

genre statistics - general statistics on the use of genres in your collection

=head1 SYNPOSIS

This script shows how to generate some basic statistics on your music
library. It returns the following statistics:

   - All genres
   - number of songs, albums, and artists in each genre

=head1 OPTIONS

Options [database]
   dsn      the name of your database
   user     database username, if required
   pass     database password if required
   adaptor  either dbi::sqlite or dbi::mysql (defaults to dbi::mysql)
   include  boolean. If true, all songs, albums, and artists will also be returned.

eg:

 genre_statistics [@options]

=head1 AUTHOR

Todd Harris (harris@cshl.org);
$Id: genre_statistics.PLS,v 1.1 2005/02/27 16:56:25 todd Exp $

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;



( run in 1.971 second using v1.01-cache-2.11-cpan-39bf76dae61 )