So this if statement would be more accurate: (to have the ability to have a
little more specific error log message)

        if ($tstatus eq 'new') {
                my ($status, $msg) =
$self->TicketObj->AddCustomFieldValue(Field => 'aantal_minuten_new', Value
=> $self->TicketObj->FirstCustomFieldValue( 'aantal_minuten_new' ) + 5,
RecordTransaction => 0 );
                unless ( $status ) {
                        $RT::Logger->error("Coudln't change Custom Field:
". $msg);
                        return 0;
                }
        }

(test run seems to work this way)

-- Bart


Op 8 december 2011 15:44 schreef Ruslan Zakirov <[email protected]> het
volgende:

> On Thu, Dec 8, 2011 at 17:00, Bart <[email protected]> wrote:
> > I think I've finished it, only have some issues with the
> $RT::Logger->error
> > thing. The scrip won't launch when I have that part enabled, when
> disabled
> > it runs just fine O_o
>
> $val is inside if {} block and lexically scoped, so it's not available
> outside.
>
> Use my ($val, $msg); if { ($val, $msg) = ... }
>
> --
> Best regards, Ruslan.
>
--------
RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5 & 6, 2012

Reply via email to