where the number varies between 1& ten, this is to generate a table of contents file that I desperately need to display in my online help tab within an existing web application. I am still fairly new to perl if anyone could help me do this I will be forever in your debt.
existing code that needs to be fixed for new file.
Expand|Select|Wrap|Line Numbers
- if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /mlxhelp/ ) {
- my $toc_file = ( $Session->{'usrType'} eq 'Pro' ) ? 'c:\SupportWeb\NerfHerder\Content\HELP\PRO\TOC.html' : 'c:\SupportWeb\NerfHerder\Content\HELP\STD\TOC.html';
- my $user_type = uc $Session->{'usrType'};
- open TOC, $toc_file;
- my @toc_lines = <TOC>;
- close TOC;
- foreach my $line ( @toc_lines ) {
- $content .= qq^<rlink tab="Help" script="frames['help_iframe'].location.href='Content/HELP/$user_type/$1'" title="$3">
- </rlink>^ if ( $line =~ /<p class="pTOC1"><a href="(.*?)"\s+target="(.*?)">(.*?)<\/a>/ );
- }
- $content .= '</leftIndex>';
- }