Subject: | arrayref of string scalars misidentified as numbers |
Statistics-R-0.22
Perl v5.10.1
Linux (CentOS) 2.6.18-194.8.1.el5 x86_64
an arrayref of the form:
Show quoted text
>my $c =
['gi|57116681|ref|NC_000962.2|', 'gi|57116681|ref|NC_000962.2|', 'gi|571
16681|ref|NC_000962.2|'];
when used with
Show quoted text>R->set('c', $c);
results in the error:
Show quoted text>Problem running the R command:
>c <- c(gi|57116681|ref|NC_000962.2|, gi|57116681|ref|NC_000962.2|,
gi|57116681|ref|NC_000962.2|)
Show quoted text>
>Got the error:
> unexpected ',' in "c <- c(gi|57116681|ref|NC_000962.2|,"
When I create the initial arrayref as follows, everything works:
Show quoted text>my $c =
['"gi|57116681|ref|NC_000962.2|"', '"gi|57116681|ref|NC_000962.2|"', '"g
i|57116681|ref|NC_000962.2|"'];
It looks to be a bug in the string identifying regex in the module on
line 425 of R.pm:
if ( $$arr[$i] !~ /$RE{num}{real}/ ) {
should be
if ( $$arr[$i] !~ /^$RE{num}{real}$/ ) {
The above change fixes the issue.