How to link my folder with its .html files using perl and html

Here is my code and folder.

Folder structure:

|-- Mus.config
|-- Mus.html
`-- Mus_Digital
    |-- Digi_Verification
    |   |-- Digi_Verification.config
    |   |-- Digital_Verification.html
    |   `-- rev1
    |       |-- _projects_Mus_Mus_Digi_Digi_Verification_rev1.config
    |       `-- _projects_Mus_Mus_Digi_Digi_Verification_rev1.html
    |-- Mus_Digital.config
    `-- Mus_Digital.html

The above is my obtained directory struture from $output_dir.Here what i really tried is conversion of .config to .html format.

Now the problem is if i click Mus folder it should open Mus.html.If i click Mus_Digital it should open Mus_Digital.html and so on.The same procedure should apply for all folders and sub folders and also for href links.

Now in my code the href links are not pointing to its *.html(here * denotes anyname before .html).Help to point directly to its html file when the folder is clicked.


print"Converting the .config files to .html files at destination location \n";
my @files = File::Find::Rule->file
foreach my $file (@files)
my ($name, $root, $ext) = $file =~ m|(.
my $outfile = “$name/$root.html”;
open my $fh_out, ‘>’, $outfile or die “Can’t open outfile: !”,"\n";
my $head = "
<!doctype html>

DCMS_CHECKLIST .bold { font-weight: bold; } .bold td { border: 0px; } table, th, td { border: 1px solid black; } "; print $fh_out $head ; # write the header open my $fh, '<', $file or die "Can't open $file: $!"; while (my $line=<$fh>) { chomp $line; for($line) { s/\&//g; #s/[\\\_\@\_]//g; s/COMMENT//g; } my @data = split /:/, $line; my $class = $data[0] ? 'normal' : 'bold'; print $fh_out qq[];

my $href=“”;

my $check=0;
my $dolink=$data[0] !~ m/[\=\%]/;
for my $word(@data){ 
print $fh_out '<td>';
if($check==1 && $dolink ) {
     print $fh_out '<a href="'.html'">'.$word.'</a>';   
  else { print $fh_out $word;} 
  print $fh_out '</td>';



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.