JimJx has asked for the wisdom of the Perl Monks concerning the following question:
The file has 48 entries in it, and I am only using 24 of these entries at a time. The file contains pairs of very similar entries. For example, $file in one entry is algiz and in another entry it is algiz-r. How do I make sure that only the first of these encountered is put into the list? IOW, if I have already added algiz-r somewhere I do not want algiz added. Hope I didn't confuse everyone too much. :-)open(FILE,"< tiles.txt") or die "error opening tiles.txt $!"; tie @text, 'Tie::File', 'tiles.txt' or die $!; @text = shuffle(@text); while (<FILE>) { ($File[$i], $Name[$i], $Keywords[$i]) = split(/:/); chomp ($Keywords[$i]); $i++; } close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array question
by chromatic (Archbishop) on Jun 16, 2003 at 03:14 UTC | |
|
Re: Array question
by Zaxo (Archbishop) on Jun 16, 2003 at 03:24 UTC | |
|
Re: Array question
by BrowserUk (Patriarch) on Jun 16, 2003 at 12:48 UTC |