You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Jonathan Vanasco <ap...@2xlp.com> on 2006/06/01 00:40:45 UTC

perl glue usage style question

this is a style question for using the perl glue, purely stylistic -  
just wondering what the accepted standard is in terms of accessing a  
param within a single cgi script

ie: access the param via $libapreq every time, or pull 1x, then use  
repeatedly

this is a halfassed illustration below showing some exceedingly poor  
design ideas.  just trying to show exxagerated scenarios.


case a:
	sub aa {
		if ( $request->param('a') eq 'b' ){
			do_stuff( $request->param('a') );
		}
		more_stuff( $request->param('a') );
		other_stuff( $request->param('a') );
		different_stuff();
	}
	sub different_stuff{
		if ( $request->param('a') eq 'b' ){
		}
	}

case b:
	sub aa {
		if ( $a eq 'b' ){
			do_stuff( $a );
		}
		more_stuff( $a );
		other_stuff( $a );
		different_stuff();
	}
	sub different_stuff{
		if ( $request->param('a') eq 'b' ){ # or rewrite to accept $a as an  
arg like the others
		}
	}