[ic] Safe: Require issues or perl-vs-calc throwdown

Mike Heins mike at perusion.com
Wed May 27 16:54:14 UTC 2009

Quoting Marty Tennison (marty at dripdepot.com):
> Perl 5.8.8
> IC 5.6.1
> I'm getting an increasing number of errors in my error log related to 
> 'safe' and 'require'.  I've searched the mail list archives and it 
> appears that others are experiencing a similar issue.  Here is an 
> example of what I am seeing....
> This does NOT work....  (in lib/UI/pages/include/Options/Matrix)
> [calc]
>     $Scratch->{built_js} =~ s/_NEXT_[A-Z]+_//g;
>     return;
> [/calc]
> This DOES work....
> [perl global=1]
>     $Scratch->{built_js} =~ s/_NEXT_[A-Z]+_//g;
>     return;
> [/perl]
> The error generated is usually something like this.....
> Safe: 'require' trapped by operation mask at (tag 'calc') line 20.
> I'm experiencing other issues similar to this where I have to enclose 
> certain blocks in perl rather than calc and the solution does not always 
> work.
> Once again, I'm stumped.  I've tried everything from...
> 1) SafeUntrap  require  (and lots more)
> 2) to moving the code around the page...
> 3) upgrading, downgrading perl modules...
> Has anyone ran into this and solved it? 

This is UTF-8 related. People are having this problem everywhere with
the latest IC. The problem is that Encode.pm pollutes regexes with 
runtime requires, prints, and other absurdities.

There is a fix in the latest nightly build, where you set the environment
variable MINIVEND_DISABLE_UTF8 before restarting the server. You can't use
UTF8, but you don't have the safe problems.

You can also try doing a 

	SafeUntrap   require print entereval caller

and seeing what happens, but the problems seem pervasive to me and
that may not get it all.

Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.328.4479  <mike at perusion.com>

Making the simple complex, that is easy -- anyone can do that.
But to make the complex simple, awesomely simple, that is
true creativity.  -- Charles Mingus 

More information about the interchange-users mailing list