## WeBWorK Main Forum

### the log function appears to be broken!

by Michael Miller -
Number of replies: 3
The following code

=============================
DOCUMENT();

TEXT(beginproblem());

$a = log(10);$b = sin(10);

BEGIN_TEXT
a=$a and b=$b
END_TEXT

ENDDOCUMENT();
==============================

produces the error message

Can't locate object method "Call" via package "CommonFunction" (perhaps you forgot to load "CommonFunction"?) at line 1382 of (eval 953) Died within main::log called at line 7 of [TMPL]/set99/01.pg

Commenting out the line "$a = log(10);" fixes the problem. The log worked earlier this semester; has something changed? Mike In reply to Michael Miller ### Re: the log function appears to be broken! by Davide Cervone - Try including "PGauxiliaryFunctions.pl" in the loadMacros() call. There was a change to the way that log() gets handled, but I don't see how it would result in the error you are getting. Davide In reply to Davide Cervone ### Re: the log function appears to be broken! by Michael Miller - The code ====================== DOCUMENT(); loadMacros("PG.pl", "PGbasicmacros.pl", "PGauxiliaryFunctions.pl"); TEXT(beginproblem());$a = log(10);
$b = sin(10); BEGIN_TEXT a=$a and b=\$b
END_TEXT

ENDDOCUMENT();
=======================

now produces the error message

Can't locate object method "log" via package "CommonFunction" at line 42 of [PG]/macros/PGcommonFunctions.pl Died within CommonFunction::Call called at line 1382 of (eval 1125) from within main::log called at line 7 of [TMPL]/set99/01.pg

As before, commenting out the line containing "log(10)" results in no error messages.

In reply to Michael Miller

### Re: the log function appears to be broken!

by Davide Cervone -
OK, it looks like I accidentally deleted the log() function from the CommonFunction package while I was trying to diagnose a warning message that I was getting. Sorry about that. I have put it back, and you will need to update your copy of pg/macros/PGcommonFunctions.pl to get the corrected version. See if that works better for you.

Davide