http://qs321.pair.com?node_id=639671

grashoper has asked for the wisdom of the Perl Monks concerning the following question:

I need to add some logic to my existing production site so that it will filter what is displayed dependent on which account customers are logging in from. My problem is that I cannot figure out where to put my "filter" as I am not that versed in perl. here is my example code..
sub tResources { my $str = ""; my $xmlResources = xmlFileData("Content/SSResources", $Session->{' +usrSystem'}.".xml", "mResources()"); $xmlResources .= xmlFileData("Content/SSResources", $Session->{'us +rSystem'}.$Session->{'usrAccount'}.".xml", "mResources()"); if (!$Request->item("ResourceID")->item()) { $str .= mLeftIndex(); } if ($Request->item("Resource")->item()) { my $res = $Request->item("Resource")->item(); my $resid = $Request->item("ResourceID")->item(); if ($xmlResources =~ /(<resource id=\"$res\".*?<\/resource>)/s) { my $selectedResource = $1; my $title = ""; my $site=$curr; $Response->Write("Site is $site!"); if ($selectedResource =~ /title=\"(.*?)\"/s) { $title = $1; } if ($Request->item("ResourceID")->item()) { if($selectedResource =~ /(<element type=\"(?:pdf|image|html| +dl|xls|ppt|doc)\" resid=\"$resid\">.*?<\/element>)/s) { $str .= "<resource>$1</resource>"; } } else { $str .= shadowBox($title, $selectedResource, ($g_docWidth/5* +4-(2*$g_docSpace))); } } } my $Site=$Request->Item("Site"); if ($Site eq "INR") { $str.=$xmlResources; return $str; exit(); } else { $str .= mTipOfTheDay(); $str .= mAlerts(); $str .= $xmlResources; } return $str; } $str.=mTipOfTheDay(); $str.=mAlerts(); I don't want these 2 to display how do I hide them? I would also like to output what site they selected (so I can verify i +ts there, as its ignoring my code, not sure how to do that either..I +am really new to this. Thanks)