Hello,
I am having a similar problem as ljsmith91. I'm using perl to write to a data file and I want to be able to sort the lines based upon a sort parameter the user defines. The field names are first name, last name, email, school, and so on. For now, a hash is fine for our purposes because we don't have any duplicates, however, as more people use the service, the more likely it is that we're going to have more than one person with the same first name or last name, etc. Could anybody suggest an alternative to the hash, or describe a way in which we could adopt the hash to ignore duplicates? The Schwartzian (sorry if I butchered the spelling) Sort was already suggested, but wouldn't that require including all the data to be sorted within the file (which is a problem for us because the data is dynamically generated)? I'm still new at this, so correct me if I've misunderstood the Schwartz Sort concept or how to implement
Thanks
I am having a similar problem as ljsmith91. I'm using perl to write to a data file and I want to be able to sort the lines based upon a sort parameter the user defines. The field names are first name, last name, email, school, and so on. For now, a hash is fine for our purposes because we don't have any duplicates, however, as more people use the service, the more likely it is that we're going to have more than one person with the same first name or last name, etc. Could anybody suggest an alternative to the hash, or describe a way in which we could adopt the hash to ignore duplicates? The Schwartzian (sorry if I butchered the spelling) Sort was already suggested, but wouldn't that require including all the data to be sorted within the file (which is a problem for us because the data is dynamically generated)? I'm still new at this, so correct me if I've misunderstood the Schwartz Sort concept or how to implement
Thanks