No strict, no warnings - even though you're "declaring" your variables with undef. my would have been shorter and better practice..
Also, rather than hardcoding the HTML generation into the code all over the place I'd rather create a list of hashes with info on each file, then churn that through a template for one of the many existing modules for the job - much cleaner and tons more flexible. A small layout change won't require someone to go digging deep inside the script's logic to find where that piece of output gets generated.
Makeshifts last the longest.