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
                }
        }

Reply via email to