--- ../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}}); } }