On 7/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
MUMPS arrays use alphanumeric indicies with a defined collating order. Numeric subscripts collate first, in numeric order, followed by string subscripts in ASCII order. Thus, an array with the following indicies would collate in this order: -2,-1,0,1,2,9,100,101.5,A,E,H,a,c,z etc. MUMPS arrays are also sparse arrays and are multidimensional. However, for this question, it is okay to assume an array with only one dimension.
Out of curiousity I looked up MUMPS and found that the sparse arays you described are modeled as B-Trees, which makes sense. The BerkeleyDB module provides access to BerkeleyDB's B-Tree structure. I believe by setting up a cursor and using $cursor->c_get($key, undef, DB_SET_RANGE) you get behavior very much like $ORDER. I have no idea what the performance will be like, but it is probably the closest thing to your real MUMPS data structure you're likely to get. http://search.cpan.org/~pmqs/BerkeleyDB-0.29/ PS It would be helpful to know how $ORDER is being used and how often. It may be that its use can be replaced with something more Perlish than trying to wedge $ORDER into Perl.