[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Adding a system wide module


On Mon, 31 Jan 2005 21:16:41 -0500, Mike Heins <suppressed> wrote:
> Quoting Jon Jensen (suppressed):
> 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
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.