[ic] Very Simple UserTag - Failed Safe Check
Ethan Rowe
ethan at endpoint.com
Thu Sep 16 14:45:02 EDT 2004
Adrian P Wilkinson wrote:
> Hi,
>
> I'm trying to define an extremely simple usertag in catalog.cgi called
> 'lease-cost' that is giving me the following error when trying to
> start up the catalogue:
>
> UserTag 'lease_cost' subroutine failed safe check: <HANDLE> trapped by
> operation mask at (eval 219) line 3, <CONFIG> line 472.
>
> Here's the text of the code:
>
> =============================================================
> UserTag lease-cost Routine <<EOR
> sub {
>
> You could lease this item for only _____ per month ex. VAT.<br>
> <small><em>[ <a href="#">Click Here for Details</a> ]</em></small>
>
> }
> EOR
> =============================================================
>
> I see a reference to the use of "use" being disallowed but I'm not
> using that function here so can't see why it's failing. I need to be
> able to configure this at catalogue level rather than server level and
> would appreciate any hints/tips on offer.
>
> This is somewhat annoying because I've done some extemely complex
> stuff in Interchange without problems but I'm now being bogged down by
> issues with the simplest routines!
The fragment above isn't a valid Perl function. If you're defining a
usertag Routine, the stuff inside the sub{ ... } needs to be Perl as
opposed to HTML.
If you literally want this usertag to return the string you've contained
within the sub{ ... }, change it to:
UserTag lease-cost Routine <<EOR
sub {
return <<EOF;
You could lease this item for only _____ per month ex. VAT.<br>
<small><em>[ <a href="#">Click Here for Details</a> ]</em></small>
EOF
}
EOR
However, there isn't much reason to use a usertag for this. I'd put the
text in an Interchange region variable instead, and then use that.
Hope this is helpful.
--
Ethan Rowe
End Point Corporation
ethan at endpoint.com
More information about the interchange-users
mailing list