Strange $RT::WebPath results

I am making some modifications to ShowTransaction and it turned out that I
needed to add the $RT::WebPath to all instances of href links in
ShowTransaction. This works fine for everything except sometimes a
mysterious “/%/” is appended to my $RT::Webpath. Notably, this occurs on
the first transaction only. So for example below, it would generate:
"/rt/%/" rather than just “/rt/”. However, on subsequent calls to
ShowTransaction, everything works fine. Has anyone else experienced
something similar?

Below is code from ShowTransaction that I have modified.

If the transaction has anything attached to it at all

if ($Transaction->Message->First && $ShowTitleBarCommands) {
if ($Transaction->TicketObj->CurrentUserHasRight(‘ReplyToTicket’)) {
$titlebar_commands .=

######Below is the line that is funky
"[<a href="" . <% $RT::WebPath %> . “/Ticket/Update.html?id=”.

$Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id.
"&Action=Respond\">Reply</a>]&nbsp;";

}
if ($Transaction->TicketObj->CurrentUserHasRight(‘CommentOnTicket’)) {
$titlebar_commands .=
"[<a href="" . <% $RT::WebPath %> .
"/Ticket/Update.html?id=".$Transaction->Ticket.
"&QuoteTransaction=".$Transaction->Id.
"&Action=Comment">Comment]";
}
}

</%INIT>

-david

David C. Chu
Network Tools Intern
America Online

Yesterday David Chu wrote:

Below is code from ShowTransaction that I have modified.

  "[<a href=\"" . <% $RT::WebPath %> . "/Ticket/Update.html?id=".

The <% … %> tags in HTML::Mason denote evaluating a Perl expression in
the middle of some HTML. Since you are already in Perl code when the
above line is being executed, so you don’t want them.

Smylers
GBdirect