[ic] Adding a system wide module
Jeff Fearn
jefffearn at gmail.com
Mon Jan 31 23:46:05 EST 2005
On Mon, 31 Jan 2005 21:16:41 -0500, Mike Heins <mike at perusion.com> wrote:
> Quoting Jon Jensen (jon at endpoint.com):
> The eval is just a tad dangerous with passed tag parameters, so I think
> I would prefer:
>
> UserTag date_calc Order op args
> UserTag date_calc Order addAttr
> UserTag date_calc Routine <<EOF
> use Date::Calc;
> sub {
> my ($op,$args,$opt) = @_;
> no strict 'refs';
> my @return;
> eval {
> @return = &{"Date::Calc::$op"}(@$args);
> };
> if($@) {
> logError("tag date-calc error: $@");
> return;
> }
> return wantarray ? @return : $return[0];
> }
> EOF
I end up going with this (how could I argue with Mike? ;). Thanks guys.
It is a little disappointing to have to get involved with the Tag code
when using perl though.
I looked at using Safe::share_from to allow Date::Calc methods to be
used in the Safe, but I'm on a deadline and have to move on :}
Jeff
More information about the interchange-users
mailing list