summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 01d7cbf)
raw | patch | inline | side by side (parent: 01d7cbf)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 19 Feb 2009 10:03:01 +0000 (11:03 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 19 Feb 2009 12:51:59 +0000 (13:51 +0100) |
bindings/perl/Collectd/Unixsock.pm | patch | blob | history |
index eb6e389e34b823d1df792f61f854c3ae183688eb..440317840a07a7de1763f175c0d9e3a44a810e8c 100644 (file)
}
else
{
- my $time = $args{'time'} ? $args{'time'} : time ();
+ my $time;
+
+ if ("ARRAY" ne ref ($args{'values'}))
+ {
+ cluck ("Invalid `values' argument (expected an array ref)");
+ return;
+ }
+
+ if (! scalar @{$args{'values'}})
+ {
+ cluck ("Empty `values' array");
+ return;
+ }
+
+ $time = $args{'time'} ? $args{'time'} : time ();
$values = join (':', $time, map { defined ($_) ? $_ : 'U' } (@{$args{'values'}}));
}