+
+#
+## Private function to convert a given rulefile to a category name.
+## ( No file extension anymore and if the name contained a dot, it
+## would be replaced by a underline sign.)
+#
+sub _rulefile_to_category($) {
+ my ($filename) = @_;
+
+ # Splitt the filename into single chunks and store them in a
+ # temorary array.
+ my @parts = split(/\./, $filename);
+
+ # Return / Remove last element of the temporary array.
+ # This removes the file extension.
+ pop @parts;
+
+ # Join together the single elements of the temporary array.
+ # If these are more than one, use a "underline" for joining.
+ my $category = join '_', @parts;
+
+ # Return the converted filename.
+ return $category;
+}