Skip Menu |

This queue is for tickets about the RT-Client-REST CPAN distribution.

Report information
The Basics
Id: 98160
Status: resolved
Priority: 0/
Queue: RT-Client-REST

People
Owner: Nobody in particular
Requestors: bmiller [...] myriad.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.50



Subject: Error in CPAN Documentation
Date: Mon, 18 Aug 2014 22:25:27 +0000
To: "bug-RT-Client-REST [...] rt.cpan.org" <bug-RT-Client-REST [...] rt.cpan.org>
From: Ben Miller <bmiller [...] myriad.com>
This webpage: http://search.cpan.org/~dams/RT-Client-REST-0.36/lib/RT/Client/REST.pm Includes an incorrect code example (I think). Read on for incorrect code and it's replacement. Example code from webpage: my @ids = $rt->search( type => 'ticket', query => "Status = 'stalled'", ); for my $id (@ids) { my ($ticket) = $rt->show(type => 'ticket', ids => [$id]); print "Subject: ", $t->{Subject}, "\n"; } I have similar code which returns a list of ticket ids and was attempting to use this code example to display the subject of each ticket, but the last line of the example code seems to be the problem. The code was always returning "" as the subject until I replaced: "print "Subject: ", $t->{Subject}, "\n";" with "print "Subject: ", $ticket->{_subject}, "\n";" This might be an issue with the documentation, or with my understanding of it, but I couldn't get the example code to work until I made this change.
Thank you for filing the report, Ben! This issue has been fixed in the v0.50 release. Here's the commit that contains the fix: https://github.com/RT-Client-REST/RT-Client-REST/commit/0863af59b8d3201df2e3e58671213eabe2fbba32 Best Regards, Sarvesh