Problem with transactionbatch and unblessed

I think I am making a silly mistake, but I can not see it.

Template as follows on 3.4.2:


my $old_user = $Ticket->CurrentUser;
$Ticket->CurrentUser( $RT::SystemUser );
my $batch = $Ticket->TransactionBatch;
my $comment;
if( !$batch || !ref($batch) ) {
$RT::Logger->info(“TransactionBatch stage is disabled.”);
} else {
$RT::Logger->info(“LCM batch “,@$batch);
while (my $trans = $batch->Next) {
$OUT .= $trans->CreatedObj->AsString . “: " . $trans->Description;
if ($trans->TimeTaken) {
$OUT .= " (”.$trans->TimeTaken.” min)”;
$OUT .= “\n”;
if ($trans->Content) {
$OUT .= $trans->Content . “\n”;
$OUT .= (’-'x78)."\n";
$Ticket->CurrentUser( $old_user );


Error I am getting is:

[Mon Aug 8 21:37:30 2005] [debug]: Found 1 scrips
[Mon Aug 8 21:37:30 2005] [error]: Template parsing error: Can’t call
method “N
ext” on unblessed reference at template line 13.

[Mon Aug 8 21:37:30 2005] [error]: error: unexpected end of header

I know that $batch has 4-5 transactions in there based on:

[Mon Aug 8 21:47:28 2005] [info]: batch RT::Transaction=HASH(0x8522d70)
RT::Transaction=HASH(0xa5d6188) RT::Transaction=HASH0xa5cf25c)
RT::Transaction=HASH(0xa5e8e78) RT::Transaction=HASH(0xa5f3f5c)

Why doesn’t the Next method work?

Any help appreciated.

This email, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this email is not the
intended recipient or his or her authorized agent, the reader is
hereby notified that any dissemination, distribution or copying of this
email is prohibited. If you have received this email in error,
please notify the sender by replying to this message and delete this
email immediately.