I don't know if this will make any sense out of context and without the modules that are used, but here's the current code.
Thanks, -John if ( $file =~ m#${templatedata}[\\/]usbank[\\/]piper_news# ) { $str = "UCM::ucmPiperNewsDB( \"$file\", \"INTERNET_\" . uc( $env ), $script )"; } elsif ( $file =~ m#${templatedata}[\\/]commercial_business[\\/]powertrack_news_article# ) { $str = "UCM::dbutil::ucmPowerTrackNewsDB( \"$file\", \"INTERNET_\" .. uc( $env ) . \"_NEWS\", $script )"; } if ( $str ne "" ) { if ( $opt_d ) { if ( $isCGI ) { print "<BR>\nSimulating $str<BR>\n"; } else { print "Simulating $str\n"; } } else { UCM::ucmDebug( "Calling $str" ); if ( $isCGI ) { print "<BR>\n$str<BR>\n"; } else { print "$str\n"; } my $ret = eval( $str ); UCM::ucmDebug( "$str returns $ret" ); if ( $ret !~ m#^\d*$# ) { push( @errors, "$str returns $ret" ); } } } At Thursday, 7 February 2002, "Brett W. McCoy" <bmccoy@chapelperilous. net> wrote: >On Thu, 7 Feb 2002, John wrote: > >> I have a block of code which determines what subroutine to call and >> what parameters to pass, I want to put the statement to execute in >> a variable. At the end of the block I would like to output/print >> the variable containing the subroutine to be called and call it. >> I played around with do and eval but couldn't get this to work. >> What is the right way? > >Would you mind posting what you have so far? It sounds like you are using >symbolic references, which is not the best way to do these kinds of >things. > >-- Brett > http://www.chapelperilous. net/ >---------------------------------------------------------------- -------- >Life does not begin at the moment of conception or the moment of birth. >It begins when the kids leave home and the dog dies. > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]