# wav2mp3.pl
# conversion des fichiers .wav du repertoire courant en mp3 par la commande systeme lame

my $dir = ".";

opendir (DIR, $dir) or die $!;
my @dir = readdir DIR;

rewinddir(DIR);

my @wavfiles = grep /\.wav/, readdir DIR;

foreach my $item (@wavfiles)
  {
    my @radical = split ( /\.wav/, $item ); 
    my $out = join('', @radical, ".mp3");
    system("lame $item $out");
  }

closedir DIR;
