#!/perl/bin/perl # # playlist.pl -- Q&D mp3 playlist generator use strict; use warnings; use Cwd; my %list; unshift @ARGV, '*/*?' if (scalar @ARGV == 1); while(<$ARGV[0]>) { if (/$ARGV[1]/) { my $path = cwd() . "/" . $_; $path =~ /\/\d\d-(.+)/; my $title = lc $1; $title =~ s/^The\s+//; $list{$title} = $path; } } print $list{$_},"\n" for (sort keys %list);