Skip Menu |
 

This queue is for tickets about the RRD-Simple CPAN distribution.

Report information
The Basics
Id: 83325
Status: new
Priority: 0/
Queue: RRD-Simple

People
Owner: Nobody in particular
Requestors: richard [...] three6five.com
Cc:
AdminCc:

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



Subject: RRD::Simple update fails when value of single ds matches regexp for timestamp
Date: Thu, 14 Feb 2013 20:10:29 +0200
To: bug-RRD-Simple [...] rt.cpan.org
From: Richard van Katwijk <richard [...] three6five.com>
Download (untitled) / with headers
text/plain 824b
Hi, The 'update' function fails when it is called with a single ds, and when the value of the ds is a large integer, which could be mistaken for a timestamp. Example: $rrd->update( 'packets'=>210188702); fails with : you must define at least one Data Source at <script>.pl line xxx While $rrd->update( 'packets'=>10188702); succeeds. This seems to be because the numeric portion of the regexp in RRD/Simple.pm (~line 239) } elsif (!(@_ % 2) && $_[1] =~ /^[1-9][0-9]{8,10}$/i) { $rrdfile = shift; matches the integer value as a timestamp and then (incorrectly) sets the $rrdfile equal to the ds name. The simple 'fix' is to insist that the $rrdfile be passed as the first parameter to the 'update' call, so that the $ds=>$value specification is never misinterpreted. Kind regards, Richard van Katwijk


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.