Ignore:
Timestamp:
04/06/17 14:48:16 (4 years ago)
Author:
kjdon
Message:

changed my mind. now declaring aStr and bStr variables, cos what if the a and b coming in are not the same as global a and b?? maybe there is room for things to go wrong? so lets explicitly declare the variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/List.pm

    r31576 r31577  
    976976sub alpha_numeric_cmp
    977977{
    978     my ($self) = shift (@_);
    979 
    980     if ($a =~ m/^(\d+(\.\d+)?)/)
     978    my $self = shift (@_);
     979    my ($aStr, $bStr) = @_;
     980    if ($aStr =~ m/^(\d+(\.\d+)?)/)
    981981    {
    982982        my $val_a = $1;
    983         if ($b =~ m/^(\d+(\.\d+)?)/)
     983        if ($bStr =~ m/^(\d+(\.\d+)?)/)
    984984        {
    985985            my $val_b = $1;
     
    991991    }
    992992   
    993     return ($a cmp $b);
     993    return ($aStr cmp $bStr);
    994994}
    995995
Note: See TracChangeset for help on using the changeset viewer.