in reply to adding control

A good rule of thumb is that a piece of code should occupy one screen. It lets you see the overall logical flow of what's going on.

To make your code more understandable to the Monks (and more importantly, yourself), you should break the code up into a series of subroutines. Each comment line is a good indicator of where a subroutine should start. As a result, you'd have:

if ($Request->item("View")->item() eq "ModifySSR") { $FileName = "$Session->{'usrSystem'}".xml; my $content = ""; my $body = ""; my $path = "content/ssresources"; if ($Request->item("Action")->item() eq "View") { DoView(); } else { ProcessModify(); } # etc. etc. } sub ProcessModify { my $req = $Request->item("Action")->item(); if ( $req eq "View" ) { DoView(); } elsif ( $req eq "Copy" ) { DoCopy(); } elsif ( $req eq "New" ) { DoNew(); } # etc. etc. }

Then you can look at the over-all flow and determine where your change is needed.