herpderpderp has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am trying to find a way to take a list of html files in a directory and make them into HTML hyperlinks for printing as HTML output.
opendir DIR, "directory/"; my @files = grep { $_ ne '.' && $_ ne '..' } readdir DIR; closedir DIR;
Are there any Perl modules that could help do the processing or will I have to procedural processing for each elements into a href links? This is relatively easy I think, except when naming the link as I would like to keep the url link name the path of the file or at least the file name. I want to be able to have the cgi script then do something like this to print the links
print <<ENDHTML; @array ENDHTML
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Turn list of files from directory into hyperlink
by kcott (Archbishop) on Apr 14, 2013 at 03:07 UTC | |
|
Re: Turn list of files from directory into hyperlink
by NetWallah (Canon) on Apr 14, 2013 at 04:30 UTC | |
|
Re: Turn list of files from directory into hyperlink
by Kenosis (Priest) on Apr 14, 2013 at 04:24 UTC | |
|
Re: Turn list of files from directory into hyperlink
by ig (Vicar) on Apr 14, 2013 at 07:57 UTC |