[ww-devel] Making Perl modules available

Davide P. Cervone dpvc at union.edu
Mon Jun 29 13:50:03 EDT 2015


You will probably need to use the explicit namespace, since that is what is imported into the safe compartment:

	Data::Dumper @$socwelbest

Give that a try.  Of not, can you post the complete problem so that we can reproduce your situation?  It is hard to tell without seeing what you are actually doing.

Davide


On Jun 29, 2015, at 1:39 PM, Andrew Dabrowski wrote:

> I should to my earlier message that I did restart httpd.  I'm running Arch Linux.
> 
> 
> I thought it would be handy to make Perl's Data::Dumper available for debugging.  So on my office computer I added the line 
> 
>     [qw(Data::Dumper)]
> 
> to ${pg}{modules} in defaults.config.  But it didn't work, I still get an error.
> 
> This is the code in my pg file to display debugging info.
> 
> BEGIN_TEXT
> 
>     \{ Dumper @$socwelbest \}
>     
> END_TEXT
> 
> The display is this.
> 
> <Mail Attachment.png>
> 
> Here's the error message.
> 
> Warning messages
> 
> ERROR in old_safe_ev, PGbasicmacros.pl: <PRE>
> ## There is an error occuring inside evaluation brackets \{ ...code... \}
> ## somewhere in an EV2 or EV3 or BEGIN_TEXT block.
> ## Code evaluated:
> ## Dumper @$socwelbest
> ##syntax error at line 2 of (eval 1132), near "Dumper @"
> ##</PRE><BR/>
> at (eval 1051) line 1671
> 
> 
> It actually works fine when I use my own dumper function, defined in a pl file (apart from the fact that my dumper isn't as nice as Perl's).
> 
> What's the correct way to do this, i.e. add a aPerl module to webwork?
> 
> 
> -- 
> Andrew Dabrowski   || ...my suspicion is that the universe is
> Indiana University || not only queerer than we suppose, but
> Swain East 117     || queerer than we can suppose. -JBS Haldane
> 
> _______________________________________________
> webwork-devel mailing list
> webwork-devel at webwork.maa.org
> http://webwork.maa.org/mailman/listinfo/webwork-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://webwork.maa.org/pipermail/webwork-devel/attachments/20150629/07dcc999/attachment.html>


More information about the webwork-devel mailing list