... my $path = File::Spec->catdir($self->{mnt}, @path); ... # and $self->add_song(glob(File::Spec->catpath($self->{mnt}, "iPod_Control", "Music", "*", "*"))); #### my $dir = $self->storage_dir; ... my @files = map { scalar( s/\.$extension//, basename $_) } glob("$dir/*.$extension"); #### ... foreach my $dir ( @ARGV ) { unless ( -d $dir ) { warn("$dir: not a directory -- skipped\n"); next; } ... my @files = sort map { $1 if /([^\/]+)\.mp3$/ } glob("$dir/[0-9]*.mp3");