[rt-users] Question on Perl Script to get queue names

Carlos Ramon Lopez Midence caralomi at hotmail.com
Wed Jun 27 11:08:32 EDT 2007


I have this perl script that I found on the list but I have an error when I run it: (my apologies if this a perl error, should find a perl list and post it there)
 
#!/usr/bin/perl
 
use lib "/var/lib/rt3";use lib "/etc/rt3";
 
package RT;
 
use strict;use warnings;use RT;use RT::Ticket;use RT::Tickets;use RT::CurrentUser;use RT::Queue;use RT::Transactions;use RT::Users;use RT::Groups;use RT::Principal;use DBI;use RT::Interface::CLI qw (CleanEnv GetCurrentUser);
 
# Load the RT configurationRT::LoadConfig();# Initialiaze RTRT::Init();
 
#-------------------------------Gets current user name:my $user = RT::User->new($RT::SystemUser);print $user;
 
#-------------------------------Gets queue namesmy $queue_id = 10;my $queue_obj = RT::Queue->new( $session{'CurrentUser'} );$queue_obj->Load( $queue_id );my $queue_name = $queue_obj->Name;print $queue_name;
----------------------------Output----------------------------
[root at test Desktop]# ./CF.pmGlobal symbol "%session" requires explicit package name at ./CF.pm line 40.Execution of ./CF.pm aborted due to compilation errors.[root at test Desktop]#
 
 
 
 
I have no clue as to what explicit package is missing: 
 
Any ideas will be greatly appreciated...
 
Carlos
 
_________________________________________________________________
Play free games, earn tickets, get cool prizes! Join Live Search Club. 
http://club.live.com/home.aspx?icid=CLUB_wlmailtextlink
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070627/d60e7510/attachment.htm>


More information about the rt-users mailing list