[Orca-users] Re: rebuild rrd files from percol files

Blair Zajac blair at akamai.com
Wed Feb 7 16:49:21 PST 2001


The patch I sent out doesn't work on Perl 5.004_05.  I'm attaching
a new patch for an unmodified src/orca.pl.in.

To avoid removing the previous patch, here is the new text you'll
need:

    # Create a new list of filenames sorted by subgroup name and
    # inside each subgroup sorted using the filename_compare
    # configuration file function or by the default compare function
    # that uses cmp to compare filenames.  This will cause the created
    # plots to appear in subgroup order.  Note that the FIDs are not
    # being sorted, but the filename the FID references.
    #
    # The compare subroutine expects the input in the $a and $b
    # package variables and since the compare subroutine was eval'ed
    # in the Orca::Config package it will look for these variables in
    # Orca::Config.  Also, since sort cannot be passed a reference to
    # a sorting subroutine stored in a hash (i.e. sort $a{b} @c), use
    # a temporary variable.  Some versions of Perl will complain that
    # fc is used only once, so declare the variable and set it in two
    # separate statements.
    @fids = ();
    {
      package Orca::Config;
      local *fc;
      *fc = $config_groups{$group_name}{filename_compare};
      foreach my $subgroup (sort keys %tmp_fids_by_subgroup) {
        push(@fids, sort fc @{$tmp_fids_by_subgroup{$subgroup}});
      }
    }

Regards,
Blair

Ake Hjalmarsson wrote:
> 
> Hi Blair,
> 
> > The attached patch should fix this problem.  Let me know if you can
> > load all of the data files in one pass with the patch installed.  If
> > it does not work, as there may be something else going on.
> 
> I tried this patch since I'm having the same problem. Know I get the
> message:
> Not a GLOB reference at /usr/local/orca/bin/orca line 988, <DATA>
> chunk 1022.
> when I try to start orca.
> 
>    983      @fids = ();
>    984      {
>    985        package Orca::Config;
>    986        my $fc = $config_groups{$group_name}{filename_compare};
>    987        foreach my $subgroup (sort keys %tmp_fids_by_subgroup) {
>    988          push(@fids, sort $fc
> @{$tmp_fids_by_subgroup{$subgroup}});
>    989        }
>    990      }
> 
> Thanks for a great program!
> 
> Ake Hjalmarsson                  Phone:    +46 455 395 982
> Ericsson Software Technology      Fax:      +46 455 815 10
> Box 518
> S-371 23 Karlskrona
> Sweden
> 
>                    Yahoo! Groups Sponsor
> 
>   Personalize your company´s name. Choose the domain name
>                   below and press SEARCH!
>      www.    [Yahoo! Domains]
> 
>
-------------- next part --------------
--- ../orca-0.26/src/orca.pl.in	Thu Mar  9 14:49:59 2000
+++ src/orca.pl.in	Wed Feb  7 16:40:57 2001
@@ -965,17 +965,26 @@
 
     # Create a new list of filenames sorted by subgroup name and
     # inside each subgroup sorted using the filename_compare
-    # configuration option function or by the Perl cmp function.  This
-    # will cause the created plots to appear in subgroup order.  The
-    # compare subroutine expects the input in the $a and $b package
-    # variables.  Since the subroutine was eval'ed in the Orca::Config
-    # package, the sort subroutine needs be in that package.
+    # configuration file function or by the default compare function
+    # that uses cmp to compare filenames.  This will cause the created
+    # plots to appear in subgroup order.  Note that the FIDs are not
+    # being sorted, but the filename the FID references.
+    #
+    # The compare subroutine expects the input in the $a and $b
+    # package variables and since the compare subroutine was eval'ed
+    # in the Orca::Config package it will look for these variables in
+    # Orca::Config.  Also, since sort cannot be passed a reference to
+    # a sorting subroutine stored in a hash (i.e. sort $a{b} @c), use
+    # a temporary variable.  Some versions of Perl will complain that
+    # fc is used only once, so declare the variable and set it in two
+    # separate statements.
     @fids = ();
     {
-      local *Orca::Config::fc = $config_groups{$group_name}{filename_compare};
+      package Orca::Config;
+      local *fc;
+      *fc = $config_groups{$group_name}{filename_compare};
       foreach my $subgroup (sort keys %tmp_fids_by_subgroup) {
-        push(@fids,
-             sort Orca::Config::fc @{$tmp_fids_by_subgroup{$subgroup}});
+        push(@fids, sort fc @{$tmp_fids_by_subgroup{$subgroup}});
       }
     }
 


More information about the Orca-users mailing list