PUB-SUB with multipart messages
file: bin/anyevent_publisher.pl 25: sub get_mp3_data { 26: use Path::Iterator::Rule; 27: my $rule = Path::Iterator::Rule->new->file->name('*.mp3'); 28: my @all; 29: my $next = $rule->iter( '/home/domm/media/mp3', {relative=>1}); 30: while ( my $file = $next->() ) { 31: my ($artist, $record, $track)=split(/\//,$file,3); 32: next unless $track && $track =~ /\.mp3$/; 33: push(@all,[ 34: $file, 35: $artist || 'unknown artist', 36: $record || 'unknown record', 37: $track 38: ]); 39: } 40: return \@all; 41: }
boring
@all