Collectd.pm: Fixed the check for complete function names in plugin_register.
authorSebastian Harl <sh@tokkee.org>
Sun, 20 Apr 2008 21:21:50 +0000 (23:21 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 30 Apr 2008 08:37:14 +0000 (10:37 +0200)
plugin_register() checks if the registered function includes the plugin's
package name. Up to now, this check would also have succeeded if the
function name itself would be prepended by the package name. Now, the
check looks for the separator "::".

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
bindings/perl/Collectd.pm

index 4377570..4ba9751 100644 (file)
@@ -246,7 +246,7 @@ sub plugin_register {
 
                my %p : shared;
 
-               if ($data !~ m/^$pkg/) {
+               if ($data !~ m/^$pkg\:\:/) {
                        $data = $pkg . "::" . $data;
                }