Web Programming Languages

Perl: Directory Read

Read the contents of a directory of images. Exclude the non-image directory entries. Create a caption by deleting the file extension and capitalizing the file name.

Choose a directory: ComicsEmbroideryCarvingTech

Marigold
Joyce
Sonny
Hannelore
Shauna
Dorothy
Claire
Dale
Walky
Lottie
Mildred
Dina

We can change the order of the files (for example, birth order instead of alphabetical order) by prepending each file name with a number and removing the number from the caption string.

Images courtesy of:
Stone Paperweight at World of Judaica
Embroidery Designs at 4-Hobby.com
Dumbing of Age
Scary Go Round
Questionable Content

Show Perl source code »