Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Turn list of files from directory into hyperlink

by Kenosis (Priest)
on Apr 14, 2013 at 04:24 UTC ( #1028595=note: print w/ replies, xml ) Need Help??


in reply to Turn list of files from directory into hyperlink

Perhaps the following will be helpful:

use strict; use warnings; use File::Glob qw/:nocase/; use File::Basename; my @htmlFiles = map { my $file = fileparse $_; qq{<a href="$file">$_</ +a><br>\n} } <directory/*.{htm,html}>; print for @htmlFiles;

Sample output:

<a href="67.htm">directory/67.htm</a><br> <a href="5a.html">directory/5a.html</a><br> <a href="a.HTML">directory/a.HTML</a><br>


Comment on Re: Turn list of files from directory into hyperlink
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-09-16 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (42 votes), past polls