in reply to Capturing Unique Data

This is a FAQ. For multiple good ideas how to do this (including code) once you've loaded your data into an array, see How can I remove duplicate elements from a list or array?

In your post, you specifically request I need to be able to capture each unique string and assign it to a variable. Is there a specific and compelling reason to use an initially unknown number of scalars as opposed to an array or hash? You could do it with Symbolic references, but those will generally cause more headaches than they will solve. In fact, using them in this kind of case is generally considered a classic example of poor form.

Replies are listed 'Best First'.
Re^2: Capturing Unique Data
by donkost (Initiate) on Aug 18, 2009 at 17:39 UTC
    Thank you. An array would be easier. I nhave never used a hash, so I'll have to look that up. d...
      If you'll spend any significant amount of time working with Perl, you'll definitely want to learn how to effectively use hashes - Perl's hash implementation is one of its greatest features. For some introductory material, see Perl variable types.
      Scalar, hash, and array. If you're going to use perl, this is the bare minimum. As consolation, note there is a lack of the usual typing demons, so any complex data structure is free from hassle.