Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 chanting in the Monastery: (4)
As of 2014-11-27 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (180 votes), past polls