I need to pass a string to a subroutine but cannot seem to get it to work, here is some sample of what I mean. snippet one is preauth file (pass thru authenticaton) topic obtained from querystring and passed to sub thelp (Hopefully result) which is not working for me. code for sub tHelp follows code snippet from preauth, in addition there is a loop in mLeftIndex() which creates the help file, I am attempting to modify the startpoint of the file..
$User = $Request->item("Login")->item(); $Site = $Request->item("Site")->item(); $topic= $Request->item("Topic")->item(); my $Referer = $Request->ServerVariables("HTTP_REFERER")->item(); $Request->ServerVariables("QUERY_STRING")->item(); use CGI; use OLE; use CGI::Simple; $query= new CGI; %ttopics = ( home => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-01-1.html', listingmgr => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-06-1.html', cma => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-11-1.html', hotsheetmgr => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-10-1.html', clientmgr => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-05-1.html', tempofinancials => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-14-1.html', tools => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-18-1.html', rep => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-12-01.html', taxmgr => 'Content/HELP/TPO\/default\//TEMPO 5 Help Topics +-13-1.html', TempoMemberInfo => 'Content/HELP/TPO\/default\//Tempo_help-01-1.htm +l', email => 'Content/HELP/TPO\/default\//Tempo_help-01-1.htm +l', ); if (!defined($topic)) { my $startpoint='Content/HELP/TPO/default/Tempo_help-08-1.html'; } my $baseurl='http://www.tempohelp.com/index.asp?tab=Help&View=#'; $nightmare = $ttopics{$topic}; my @topicvalues=$nightmare; my @baseurl=$baseurl; tHelp(@baseurl,@startpoint);
tHelp
sub tHelp { $baseurl=shift(@baseurl); $startpoint=shift(@topicvalues); $Response->write("$baseurl"."$startpoint"); # This returns values for baseurl and startpoint so far so #good then deeper in my sub when I go to use startpoint it does not work why +? if ($Session->{'usrType'} eq 'Std') { if ($Request->ServerVariables("SERVER_NAME")->item()=~/tempohelp/i +) { #my startpoint='Content/HELP/TPO/default/Tempo_help-08-1.html'; my $target='Tempo%20help_frame'; $str .= shadowBox("Tempo Help", qq^<help_iframe name="$target" startpo +int="$startpoint"/>^ , ($g_docWidth/5*4-(2*$g_docSpace))); return $str; } }
finally code for loop to generate helpfile into iframe.
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/'} $startpoint=shift(@topicvalues); 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>'; }

In reply to problems passing to subroutine 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.