Re: [rt-users] Can't call method Name without a package or object reference
I'm replying to this question because you've asked variants on it 3 times today and I assume this is the closest to your current code. On Mon, Oct 21, 2013 at 08:53:17PM -0400, Mathew Snyder wrote: I'm trying to use RT::Queue to load up a specific queue to work with. Right now I'm keeping it simple just to get the functionality in place: #!/usr/bin/perl use warnings; use strict; use lib '/opt/rt4/lib'; use RT::Queue; my $queue = RT::Queue-new( $RT::SystemUser ); my $qLoad = $queue-Load(6); my $qName = $qLoad-Name; print $qName . \n; This results in the error in the subject? What am I doing wrong? You're not initializing RT correctly, so RT-SystemUser isn't set up yet. http://bestpractical.com/docs/rt/latest/RT.html#INITIALIZATION -kevin pgpSQzIaetTVg.pgp Description: PGP signature
Re: [rt-users] Can't call method Name without a package or object reference
On Tue, 2013-10-22 at 12:55 -0400, Kevin Falcone wrote: I'm replying to this question because you've asked variants on it 3 times today and I assume this is the closest to your current code. On Mon, Oct 21, 2013 at 08:53:17PM -0400, Mathew Snyder wrote: I'm trying to use RT::Queue to load up a specific queue to work with. Right now I'm keeping it simple just to get the functionality in place: #!/usr/bin/perl use warnings; use strict; use lib '/opt/rt4/lib'; use RT::Queue; my $queue = RT::Queue-new( $RT::SystemUser ); my $qLoad = $queue-Load(6); my $qName = $qLoad-Name; print $qName . \n; This results in the error in the subject? What am I doing wrong? You're not initializing RT correctly, so RT-SystemUser isn't set up yet. http://bestpractical.com/docs/rt/latest/RT.html#INITIALIZATION Additionally, you should be calling -Name on $queue, not on $qLoad. $qLoad is just a success/failure return value -- $queue is the object that has now been loaded. - Alex
Re: [rt-users] Can't call method Name without a package or object reference
Yes. I apologize. I would submit an email and then sort out the problem after working it some more. That did happen a couple times and then ended up with this one. -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 On Tue, Oct 22, 2013 at 12:55 PM, Kevin Falcone falc...@bestpractical.comwrote: I'm replying to this question because you've asked variants on it 3 times today and I assume this is the closest to your current code. On Mon, Oct 21, 2013 at 08:53:17PM -0400, Mathew Snyder wrote: I'm trying to use RT::Queue to load up a specific queue to work with. Right now I'm keeping it simple just to get the functionality in place: #!/usr/bin/perl use warnings; use strict; use lib '/opt/rt4/lib'; use RT::Queue; my $queue = RT::Queue-new( $RT::SystemUser ); my $qLoad = $queue-Load(6); my $qName = $qLoad-Name; print $qName . \n; This results in the error in the subject? What am I doing wrong? You're not initializing RT correctly, so RT-SystemUser isn't set up yet. http://bestpractical.com/docs/rt/latest/RT.html#INITIALIZATION -kevin
Re: [rt-users] Can't call method Name without a package or object reference
Thank you. I've added 'use RT -init;' to my code. -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 On Tue, Oct 22, 2013 at 12:55 PM, Kevin Falcone falc...@bestpractical.comwrote: I'm replying to this question because you've asked variants on it 3 times today and I assume this is the closest to your current code. On Mon, Oct 21, 2013 at 08:53:17PM -0400, Mathew Snyder wrote: I'm trying to use RT::Queue to load up a specific queue to work with. Right now I'm keeping it simple just to get the functionality in place: #!/usr/bin/perl use warnings; use strict; use lib '/opt/rt4/lib'; use RT::Queue; my $queue = RT::Queue-new( $RT::SystemUser ); my $qLoad = $queue-Load(6); my $qName = $qLoad-Name; print $qName . \n; This results in the error in the subject? What am I doing wrong? You're not initializing RT correctly, so RT-SystemUser isn't set up yet. http://bestpractical.com/docs/rt/latest/RT.html#INITIALIZATION -kevin
Re: [rt-users] Can't call method Name without a package or object reference
If I use this: my $queue = RT::Queue-new( RT-SystemUser ); $queue = Load( 6 ); my $qName = $queue-Name; I get this: Undefined subroutine main::Load called at... I'm defining $queue as an RT::Queue object which should have the Load subroutine. Why would it be undefined? -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 On Tue, Oct 22, 2013 at 1:21 PM, Alex Vandiver ale...@bestpractical.comwrote: On Tue, 2013-10-22 at 12:55 -0400, Kevin Falcone wrote: I'm replying to this question because you've asked variants on it 3 times today and I assume this is the closest to your current code. On Mon, Oct 21, 2013 at 08:53:17PM -0400, Mathew Snyder wrote: I'm trying to use RT::Queue to load up a specific queue to work with. Right now I'm keeping it simple just to get the functionality in place: #!/usr/bin/perl use warnings; use strict; use lib '/opt/rt4/lib'; use RT::Queue; my $queue = RT::Queue-new( $RT::SystemUser ); my $qLoad = $queue-Load(6); my $qName = $qLoad-Name; print $qName . \n; This results in the error in the subject? What am I doing wrong? You're not initializing RT correctly, so RT-SystemUser isn't set up yet. http://bestpractical.com/docs/rt/latest/RT.html#INITIALIZATION Additionally, you should be calling -Name on $queue, not on $qLoad. $qLoad is just a success/failure return value -- $queue is the object that has now been loaded. - Alex
[rt-users] Can't call method Name without a package or object reference
I'm trying to use RT::Queue to load up a specific queue to work with. Right now I'm keeping it simple just to get the functionality in place: #!/usr/bin/perl use warnings; use strict; use lib '/opt/rt4/lib'; use RT::Queue; my $queue = RT::Queue-new( $RT::SystemUser ); my $qLoad = $queue-Load(6); my $qName = $qLoad-Name; print $qName . \n; This results in the error in the subject? 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