in reply to rigthmp3names

my @arquivos = grep /\.mp3/i, readdir DIR;

Shouldn't that be

my @arquivos = grep /\.mp3$/i, readdir DIR;
just in case you have a filename like my.mp3.wav ?

I'm not really a human, but I play one on earth. flash japh