in reply to split to hash, problem with random keys

What about this: @iRecord{sort keys %iRecord} = split(/\|/, $line);

Replies are listed 'Best First'.
Re: Re: split to hash, problem with random keys
by Mr. Muskrat (Canon) on Jul 03, 2003 at 16:47 UTC
    This method assumes that the keys are to be sorted alphabetically which is probably not how they were originally ordered.

      No, they're not, indeed. It's just the order I defined them in, and that is the order which is most easy to read and understand, code-wise.

      I *could* sort them, but I really want to have a certain order in my flat file, with the key in front.