[rt-users] Subroutine redifined error on fresh 4.2 installation.
Mathew Snyder
mathew.snyder at gmail.com
Sun Oct 20 21:28:57 EDT 2013
Trying to figure out why I keep getting various "Subroutine * redefined at
/opt/rt4/lib/RT/URI.pm..." error.
All I'm trying to do right now is print out a list of new, unowned tickets
from a queue.
Script:
#!/usr/bin/perl
use warnings;
use strict;
use lib '/opt/rt4/lib/RT';
use lib '/opt/rt4/local/lib';
use RT::Tickets;
use RT::Users;
my $unacted_tickets;
my $tix = new RT::Tickets("RT::SystemUser");
$tix->FromSQL('Queue = "Service Desk" AND Status = "new" AND Owner =
"Nobody"');
while (my $ticket = $tix->Next) {
my $diff = time - (str2time($ticket->Created) - 18000);
print $ticket->id . ": " . (str2time($ticket->Created) - 18000) .
"\n";
print "time: " . time() . "\n";
print "diff: " . $diff . "\n";
print "diff adjusted: " . $diff/60 . "\n";
}
exit;
Output:
Subroutine new redefined at /opt/rt4/lib/RT/URI.pm line 83.
Subroutine CanonicalizeURI redefined at /opt/rt4/lib/RT/URI.pm line 102.
Subroutine FromObject redefined at /opt/rt4/lib/RT/URI.pm line 123.
Subroutine FromURI redefined at /opt/rt4/lib/RT/URI.pm line 142.
Subroutine _GetResolver redefined at /opt/rt4/lib/RT/URI.pm line 186.
Subroutine Scheme redefined at /opt/rt4/lib/RT/URI.pm line 218.
Subroutine URI redefined at /opt/rt4/lib/RT/URI.pm line 231.
Subroutine Object redefined at /opt/rt4/lib/RT/URI.pm line 245.
Subroutine IsLocal redefined at /opt/rt4/lib/RT/URI.pm line 260.
Subroutine AsHREF redefined at /opt/rt4/lib/RT/URI.pm line 273.
Subroutine Resolver redefined at /opt/rt4/lib/RT/URI.pm line 285.
Subroutine AsString redefined at /opt/rt4/lib/RT/URI.pm line 296.
Can't call method "error" on an undefined value at
/opt/rt4/lib/RT/Tickets.pm line 3001.
It's been a while since I've written scripts that use the RT API so I don't
know if things have changed in how the environment is set up. What am I
doing wrong?
-Mathew
"When you do things right, people won't be sure you've done anything at
all." - God; Futurama
"We'll get along much better once you accept that you're wrong and neither
am I." - Me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20131020/a0f18fa3/attachment.htm>
More information about the rt-users
mailing list