There are many ways to do anything- And this function is no exception. I
initially wrote an more expanded, twelve-line version that essentially did the
same thing, but decided that I should use a bit of Perl magic, and make it a
little shorter.
Extracting those three functions from the code cleans it up quite a bit
(although there is still room for another function or two). So now we have to
build a system that utilizes those functions to perform our four tasks:
index.html file and extract the
If you were wondering why I was concerned with “depth” back in
the Functions section, here’s where it will make sense. I use the depth of the
folder, to stratify where in an unordered list the item belongs (how
“deep” in the list). This give our table of contents a
more readable, and understandable feel, than just throwing out a flat list of
links:
1: my $dir="/usr/local/apache/htdocs/";: unshift(@dirs,Get_Dirs("$currdir")); |
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.