opendir THISDIR, "." or die "serious dainbramagae: $!"; @allfiles = readdir THISDIR; closedir THISDIR; while (@allfiles) { $allfiles[0] =~ s/\s*\S+\.\S+\.*\S*\.*\S*\s*//; $array[$i] = $allfiles[0]; shift @allfiles; $i++ } shift @array; s/\s*//g; my $count = @array; $count++; while (@array2, $k<$count) { print "[$k] $array2[$j]\t"; $j++; $k++; }