[EMAIL PROTECTED] (Vic Norton) wrote:
>Thanks Bruce Van Allen and Ken Williams!
>
>I've just implemented Bruce's suggestion:
>
>    sub naturalorder {
>    # A subroutine that sorts like the Macintosh Natural Order extension.
>    # Created by Vic Norton, 26 Nov 2000.
>    # Modified to work in an external package on 27 Jan 2001;
>    # Thanks to Bruce Van Allen <[EMAIL PROTECTED]>.
>
>    # Bruce Van Allen's modification
>        my ($pkg) = caller;
>        no strict 'refs';
>        my $a = ${$pkg.'::a'};
>        my $b = ${$pkg.'::b'};
>
>    # Norton's original routine continues from here
>        my $u = lc($a);
>        my $v = lc($b);
>        ...
>    }
>

Hi Vic,

It sounds like this solution works well for you in this case, but for
larger or more oft-sorted arrays the overhead of calling 'caller' each
time might get sluggish.  So hang on to the other methods for the future
as well.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum

Reply via email to