Forum archive 2000-2006

ymarkov - Perl warning - configuration problem?

ymarkov - Perl warning - configuration problem?

by Arnold Pizer -
Number of replies: 0
inactiveTopicPerl warning - configuration problem? topic started 9/28/2001; 8:19:02 PM
last post 9/28/2001; 8:28:58 PM
userymarkov - Perl warning - configuration problem?  blueArrow
9/28/2001; 8:19:02 PM (reads: 978, responses: 1)
I have the following problem. On some problems of various nature, I get a pink warning screen and a message that is appended below. WebWork still evaluates my answers correctly, so I was wondering what might be the reason for the warning message. Thanks a lot. The tip about the logout page worked fine.

Yavor

*Compiler warnings:



* This option |vars| is not recognized in this subroutine
HASH(0x8a2ad74)
store_in
=>
rf_correct_ans
vars
=>
( x , )



at (eval 110) line 3587.
##More details:
-------- PG_priv::set_default_options called at (eval 110) line 2096
---- PG_priv::function_from_string2 called at (eval 111) line 352
---- PG_priv::string_to_sub called at (eval 111) line 217
---- PG_priv::plot_functions called at (eval 50) line 37
---- PG_priv::__ANON__ called at /usr/local/lib/perl5/5.6.1/i686-linux/Safe.pm line 222
---- Safe::reval called at /webwork/s1/WWW/webwork/system//PGtranslator.pm line 691
---- PGtranslator::translate called at /webwork/s1/WWW/webwork/system/cgi/cgi-scripts/processProblem8.pl line 420



-----------------------------------





<| Post or View Comments |>


userMichael Gage - Re: Perl warning - configuration problem?  blueArrow
9/28/2001; 8:28:58 PM (reads: 1230, responses: 0)
You have an old version of either PGgraphmacros.pl or PGanswermacros.pl or both.

The call from string_to_sub to function_from_string2 is using obsolete option names and this is being caught by set_default_options

You can probably fix this for now by changing 'vars' = to 'ra_vars' = in string_to_sub subroutine as shown below.

 

 sub string_to_sub {
my $str_in = shift;
my $var = shift;
my $out = undef;
if ( defined(&check_syntax) ) {
#prepare the correct answer and check it's syntax
my $rh_correct_ans = new AnswerHash;
$rh_correct_ans-input($str_in);
$rh_correct_ans = check_syntax($rh_correct_ans);
warn $rh_correct_ans-{error_message} if
$rh_correct_ans-{error_flag};
$rh_correct_ans-clear_error();
$rh_correct_ans = function_from_string2($rh_correct_ans,
ra_vars => ['x'], store_in =>'rf_correct_ans');
my $correct_eqn_sub = $rh_correct_ans-{rf_correct_ans}
warn $rh_correct_ans-{error_message} if
$rh_correct_ans-{error_flag};
$out = sub{ scalar( &$correct_eqn_sub(@_) ) }; #ignore the error
messages from the function.



} else {
my $in =$str_in;



$in =~ s/b$varb/$XVAR/g;
$in = &my_math_constants($in);
my ($subRef, $PG_eval_errors,$PG_full_error_report) = PG_restricted_eval(
" sub {
my $XVAR = shift; my $out = $in; $out; } "); if
($PG_eval_errors) {
die " ERROR while defining a function from the string:n\n$main::BR
$main::BR $str_in $main::BR $main::BRn\n $PG_eval_errors" } else {
$out = $subRef;
}



}
$out;
}

You could also get the newest versions of PGanswermacros.pl and PGgraphmacros.pl from http://webwork.math.rochester.edu/cgi-bin/cvsweb.cgi -- they'll all be out in the new version 1.7 of webwork which Arnie should have ready shortly.

-- you'll see that in addition to fixing the string_to_sub subroutine, the function_from_string2 subroutine has been modified to allow vars as an alias for ra_vars

Hope that clears things up.

-- Mike

<| Post or View Comments |>