I'm trying to rewrite part of a script to use the RT::Date module as opposed to
something else like Date::Simple.  However, I'm not sure how to start it.  I'm
using this to test things:

#!/usr/bin/perl

use warnings;
use strict;
use lib '/usr/local/rt-3.6.1/lib';
use lib '/usr/local/rt-3.6.1/local/lib';
use RT;
use RT::Tickets;
use RT::Users;
use RT::Date;
use RT::Action::Generic;

RT::LoadConfig();
RT::Init();

sub try {
        my $self = shift;
        my $due = $self->TicketObj->DueObj();
        print $due->Unix() . "\n";
}

&try;

But I keep getting "Can't call method "TicketObj" on an undefined value at
/usr/local/bin/date_test.pl line 18."  I suspect it has something to do with
$self not being initialized.  This is the first time I've tried doing things
this way so I'm not sure how to do it.  Any help will be appreciated.

Thanks
Mathew

-- 
Keep up with me and what I'm up to: http://theillien.blogspot.com
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to