[ww-devel] Making Perl modules available

Davide P. Cervone dpvc at union.edu
Mon Jun 29 19:44:16 EDT 2015


> That's it!  Thanks!

I'm glad it worked out.

> A related question:  There are a number of functions in List::Util that would be useful in writing problems.  Most have been reimplemented in PGauxiliaryFunctions.pl, but would there be a security risk in adding List::Util to the real server?

I don't see anything that would be a security risk, but there are some things that might be issues for PG problems.  A number of the functions take code blocks (like the sort does), and these use variables $a and $b that are not localized, if I recall correctly.  This could interact badly with problems that use $a and $b as coefficients or other variables (many problems do).  This is one reason that the perl sort function is replaced by PGsort in PG.  You can certainly work around this, but it is something to keep in mind, especially if you are going to write macros that are to be used by others authors.

I'm happy to include additional perl modules when they add significant functionality; but my impression is that List::Util are basically convenience routines that could all be handled fairly readily "by hand" either in perl directly, or through a macro file that doesn't require additional modules.  You are free, of course, to include this on your own server and write problems that rely on them, but be aware that it will be harder for you to distribute them to others.  In order to use your problems, they would have to have access to the WeBWorK configuration, which not everyone does.  This might make it harder to incorporate them into the OPL, if that is something you are considering.

Davide




More information about the webwork-devel mailing list