[ic] AllowGllobal/UserTag - I need a help please

Mike Heins interchange-users@interchange.redhat.com
Tue Mar 19 22:48:01 2002


Quoting Alma Nuker (alma@youramigo.com):
> Hi guys;
> 
> Looking trough all doc and mailing list I am even more confused about
> AllowGlobal/UserTag use.
> 
> I am trying to set up my own UserTag as follow:
> 
> UserTag get-url Order duedate
> UserTag get_date AddAttr
> UserTag get_date Documentation <<EOD
> 
> usage: [get_date duedate]
> Some text in here.
> EOD

Do this instead:


UserTag get_date Routine <<EOR

require Date::Parse;
requireDate::Manip;
require Date::Format;

sub {

    my($duedate)=@_;


    my $new_date = &ParseDate($duedate);
    my $date_new=&DateCalc($new_date,"+ 1year",\my $err);
    my @format="%Y-%m-%d";
    my $final_date=&UnixDate($date_new,@format);
    return $final_date;
}

EOR

You simply cannot do a runtime require in Safe. Period. Ever. No matter
what the setting of AllowGlobal.

The above makes the require at compile time, which should work assuming
the rest of your code is correct.
-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Nature, to be commanded, must be obeyed. -- Francis Bacon