Skip Menu |

This queue is for tickets about the Statistics-R CPAN distribution.

Report information
The Basics
Id: 61335
Status: resolved
Priority: 0/
Queue: Statistics-R

People
Owner: Nobody in particular
Requestors: florent.c.delmotte [...] bankofamerica.com
Cc:
AdminCc:

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



Subject: bug report for Statistics::R version 0.05
Date: Tue, 14 Sep 2010 16:27:09 -0400
To: bug-Statistics-R [...] rt.cpan.org
From: "Delmotte, Florent C" <florent.c.delmotte [...] bankofamerica.com>
Hello, I believe there is a bug with the 'error' sub of the current version (0.05) of Statistics::R. Consider the following use: use strict; use warnings; use Statistics::R; my $r = Statistics::R->new(); $r->send('x <- 5'); my $error = $r->error(); When executed, this script dies as follows: Use of uninitialized value in string ne at /mass/perl589/lib/site_perl/5.8.9/Statistics/R.pm line 33. Use of uninitialized value in warn at /mass/perl589/lib/site_perl/5.8.9/Statistics/R.pm line 35. Warning: something's wrong at /mass/perl589/lib/site_perl/5.8.9/Statistics/R.pm line 35. My suggested fix would be: sub error { my $this = shift; splice( @ERROR, 0, ( $#ERROR - 10 ) ) if @ERROR > 10; return @ERROR if wantarray; return $ERROR[ -1 ]; } Sincerely, F.D.
Fixed in git [1]. I'm not really happy with that method, but I've fixed the case where it is called with no parameters. Thanks for the report! -Brian [1] http://github.com/bricas/statistics-r/commit/47abf0d4e0073a402c1e4b16aac31b2d5c262ca4