On Feb 7, John said:

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

>if ( $file =~ m#${templatedata}[\\/]usbank[\\/]piper_news# )
>{
>    $str = "UCM::ucmPiperNewsDB( \"$file\", \"INTERNET_\" . uc( $env 
>), $script )";
>}

Why not just say

  $str = 'UCM::ucmPiperNewsDB($file, uc("INTERNET_$env"), $script)'

The single quotes make practically NOTHING get interpolated, and you don't
need them to interpolate yet.  You can just eval() it later.

However, I'd suggest a different approach entirely:

  ($func, $fname, @args) = (
    "UCM::ucmPiperNewsDB",
    \&UCM::ucmPiperNewsDB,
    $file, uc("INTERNET_$env"), $script,
  );


>            print "Simulating $str\n";

  print "Simulating $func(@args)\n";

>        my $ret = eval( $str );

  my $ret = $func->(@args);

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to