I dont understand this Help me to fix issue where i struck with.

but im going to guess its at

print $fh_out '<a href="'.$outfile{$word}.'">';
that you are having problems. $outfile is a scalar my $outfile = "$dir/$root.html"; and not an hash so you can t"address into" it with {$word}. Now in $outfile also contains a filesystem name and not a http url. It is quite possible to change $outfile into a uri by knowing your web-server-root directory and changing that subsection at the beginning of $outfile to "http://some.server.name/", or just removing it and creating a relative (to the webserver) uri. But $outfile in itself is not a valid uri.

But even then $outfile is the file you are writing to now, so i find it kinda hard to believe you want a hyperlink to the same webpage you are on now. Maybe you want to hyperlink to another section with a "#subpart" reference, or maybe you want to link to some other page than the one you are on now. But you still have not said where it is you want to link to.

So, if you are printing what is contained in $word into the first column, just where is it that you want to link to. is it based on what is in $word (SL.NO)? Is it based on what goes into the columns CHECKLIST ITEM, or VALUE, or COMMENTS, or CONFIRMATION? if you can tell me what is the uri you want to link the row to, i can explain what to change $outfile{$word} to. If you can construct a variable containing a valid url, like  my $href="http:/some.server.name/$part1/$part2/$part3"; replaceing $part1, $part2, $part3 with some combination of $dir, $root, $ext, $data[0], $data[1], $data[2], $data[3],$data[4] just code it before the my $check=0; line and change print $fh_out '<a href="'.$outfile{$word}.'">'; to print $fh_out '<a href="'.$href.'">';

and if that is all of your code, you are still have a lost </table>. i do see the <table> table and <th>...</th> header tags, but you should close your table too. It is nice to close the body and html tags as well, but less required. An unclosed table tag can present an error condition at times.

But i am not a mindreader and i still dont know where you want to link to because you have not told me yet.


In reply to Re^3: How to add hyperlink for every table data using perl? by huck
in thread How to add hyperlink for every table data using perl? by finddata

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.