in reply to Turn list of files from directory into hyperlink
G'day herpderpderp,
Welcome to the monastery.
The basic coding for this is pretty straightforward:
$ perl -Mstrict -Mwarnings -E ' my @dir_files = qw{. .. .hidden.html a.txt b.pdf c.html d.pl e.sql + f.xml g.h.i.html}; my @files = grep { ! /^[.]{1,2}$/ and /[.]html$/ } @dir_files; say qq{<a href="$_">$_</a>} for @files; ' <a href=".hidden.html">.hidden.html</a> <a href="c.html">c.html</a> <a href="g.h.i.html">g.h.i.html</a>
Modules that might help with this: File::Find (Builtin Module); File::Find::Rule (CPAN Module).
-- Ken
|
|---|