This is a question using eval.

Below is some test code using eval.
It worked. A function call was loaded to a variable ($func_name)
and eval calls the function and passes the variables.


$func_name = "&make_shift";    ## load the function call and its name

push(@data, eval"$func_name(4,5,6)");    ## call function and load results in @data

print "This is data @data \n";       # prints "This is data help is on the way 1 2 3"

sub  make_shift() {
           my($a,$b,$c) = @_;

print "please help \n";
return "help is on the way $a $b $c \n";

}



***************************************************
I used the same logic at work and the eval does NOT respond.
I used ACTIVESTATE's debuger, and it shows all variables have values,
including the $setf, yet the eval does nothing.  

$setf = "&SetFieldGG";

&preprint;


sub preprint { 

# a lot of code
.... 
 
push(@data, eval"$setf($FIELD{$key}, $dataStr, $flagBold, $flagNoWord)");          

}

sub setFieldGG  {       <<-- This is not called
    local($Field, $Str, $Flag, $FlagNoWordWrap) = @_;

.....

}




What am I doing wrong?

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

Reply via email to