#!/usr/bin/perl -wT use strict; use constant SONG_DIR => 'd:\my files'; opendir(SONGS, SONG_DIR) or die "could not open the ", SONG_DIR, " directory: $!"; my @songs = sort grep { /\.mp3$/ } readdir SONGS; closedir SONGS;