working on a larger problem broke down into smaller parts here is whats working as well as whats not. 1) succesfully setup a hash with structure of topics as key and values are the relevant html files, reading in the topic value from the query string and matching it to my %hash verified this part is working by writing out to my browser forced an error to capture the write now I need to pass the target which I called $nightmare to my help subroutine.. Help subroutine--> passes startpoint into mLeftIndex, which sets which helpfile and provides content to you guessed it the leftIndex of a frameset.(I know I hate Iframes but thats what I am stuck with). I cannot use strict as I have a problem with it that I have not been able to figure out as of yet.
<% @Language="PerlScript" %> <!--#Include File="base/base.asp"--> <!--#Include File="base/core.asp"--> <!--#Include File="base/helper.asp"--> <!--#Include File="base/modules.asp"--> <% my $User = $Request->item("Login")->item(); my $Site = $Request->item("Site")->item(); $topic= $Request->item("Topic")->item(); my $Referer = $Request->ServerVariables("HTTP_REFERER")->item(); use CGI; use ASP; use OLE; $query= new CGI; my %ttopics = ( home => 'TEMPO%205%20Help%20Topics-01-1.html', listingmgr => 'TEMPO%205%20Help%20Topics-06-1.html', ); if (!defined($topic)) { # ...handle error... } $nightmare = $ttopics{$topic}; if (!defined($target)) { # ...handle error... } $Response->Write("Topic is $topic\n"); $Response->Write("my target is $nightmare\n"); }
Sub tHelp-> sets startpoint.
sub tHelp { my $str = ""; my $startpoint=$nightmare=@_; # Are We Tempo? if ($Session->{'usrType'} eq 'Std') { if ($Request->ServerVariables("SERVER_NAME")->item()=~/tempohelp/i +) { my $target='Tempo%20help_frame'; $str .= shadowBox("Tempo Help", qq^<help_iframe name="$target" +startpoint="$startpoint"/>^ , ($g_docWidth/5*4-(2*$g_docSpace))); return $str; } } }
Here is main which calls thelp.
sub pMain { my ($dWidth) = @_; my $str = ""; my $xmlFSO = CreateObject OLE "Scripting.FileSystemObject"; if ($Request->item("xURL")->item()) { lg("ACTIVITY","REFERRAL:".$Request->item("xURL")->item()); $str .= "<xURL href=\"".$Request->item("xURL")->item()."\"/>"; } if ($Request->item("xResource")->item()) { lg("ACTIVITY","Resource:".$Request->item("xResource")->item()); $str .= "<xResource href=\"".$Request->item("xResource")->item() +."\" height=\"".$Request->item("xRh")->item()."\" width=\"".$Request- +>item("xRw")->item()."\"/>"; } SWITCH: { if ($Request->item("View")->item() eq "Logout"){ $str .= mLogout +(); last SWITCH; } if ($Request->item("Tab")->item() eq "Help"){ $str .= +&tHelp($nightmare); last SWITCH; } if ($Request->item("Tab")->item() eq "Support"){ $str .= tSuppor +t(); last SWITCH; } if ($Request->item("Tab")->item() eq "Admin"){ $str .= tAdm +in(); last SWITCH; } } return $str; }
Sub document that outputs doc.
$xmlPage = "<document here=\ queryString=\"$queryString\" docWidth=\"$dWidth\" scWidth=\"".$Session->{'screenX'}."\" scHeight=\"".$Session->{'screenY'}."\" docSpace=\"$g_docSpace\" uClass=\"".$uClass."\" uTitle=\"".$1."\" uDesc=\"".$2."\""; $xmlPage .= $Session->{'statsRights'} ? " statsRights=\"".$Session +->{'statsRights'}."\"" : ""; $xmlPage .= $Session->{'adminRights'} ? " adminRights=\"".$Session +->{'adminRights'}."\"" : ""; $xmlPage .= " date=\"$year".pad($mon,2).pad($mday,2)."\" wDay=\"$wday\" time=\"".pad($hour,2).pad($min,2)."\" + cBackground=\"$c_Background\" cElement=\"$c_Element\" cFrame=\"$c_Frame\" cShadow=\"$c_Shadow\" cLink=\"$c_Link\" cText=\"$c_Text\">\n"; $xmlPage .= css(); $xmlPage .= admin(); $xmlPage .= config(); $xmlPage .= jscripts(); $xmlPage .= adverts(); $xmlPage .= header(); $xmlPage .= body($dWidth); $xmlPage .= footer(); $xmlPage .= "\n</document>"; return $xmlPage; }
Here is mLeftIndex();
sub mLeftIndex { my $str = ""; my $logoutLink = "<link tab=\"\" view=\"Logout\" title=\"Logout\"/ +>"; my $content = '<leftIndex>'; if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /mlxhelp/ + ) { my $toc_file = ( $Session->{'usrType'} eq 'Pro' ) ? 'e:\Suppor +tWeb\Content\HELP\PRO\TOC.html' : 'e:\SupportWeb\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_ifra +me'].location.href='Content/HELP/$user_type/$1'" title="$3"> </rlink>^ if ( $line =~ /<p class="pTOC1"><a href= +"(.*?)"\s+target="(.*?)">(.*?)<\/a>/ ); } $content .= '</leftIndex>'; } if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /tempohelp/ ) + { my $toc_file = ( $Session->{'usrType'} eq 'Pro' ) ? 'e:\Suppor +tWeb\Content\HELP\PRO\TOC.html' : 'e:\SupportWeb\Content\help\tpo\def +ault\TOC.html'; my $user_type = uc $Session->{'usrType'}; if ($user_type='STD') {$user_type='TPO\/default\/'} open TOC, $toc_file; my @toc_lines = <TOC>; close TOC; foreach my $line ( @toc_lines ) { $content .= qq^<rlink tab="Help" script="frames['help_ifra +me'].location.href='Content/HELP/$user_type/$1'" title="$3"> </rlink>^ if ( $line =~ /<p class="pTOC\d"><a href +="(.*?)"\s+target="(.*?)">(.*?)<\/a>/ ); } $content .= '</leftIndex>'; }
function that calls transforms
sub transform { my $trns = $Server->MapPath("Transforms/pLogin.xsl"); if ($Session->{'isAuthenticated'}) { getMOTD(); SWITCH: { if ($Request->item("View")->item() eq "Resources") { $trns = $Server->MapPath("Transforms/tResources.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Support") { $trns = $Server->MapPath("Transforms/tSupport.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Help") { $trns = $Server->MapPath("Transforms/tHelp.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Training") { $trns = $Server->MapPath("Transforms/tTraining.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Trainers") { $trns = $Server->MapPath("Transforms/tTrainers.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Admin") { $trns = $Server->MapPath("Transforms/tAdmin.xsl"); last SWITCH; } $trns = $Server->MapPath("Transforms/pMain.xsl"); } } return $trns; }

In reply to printing out hash by grashoper

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.