in reply to Deciding unique elements of an array

For the first point, like all things, there is more than one way to do it. Typically I'd use a hash, for example I'd do:
#!/usr/bin/perl -w use strict; my @dup_array = qw/this this array has has duplicates/; my @unique_array; my %uniques; foreach my $elem (@dup_array) { push @unique_array, $elem unless $unique{$elem}++; } print "Unique elements are @unique_array";
For the second problem, I think that you want to write something like
my @lines = <>;
Using <> in a list context gives you every line of input as an element of your array. That is $line[0] is your first line of code.

Mind you, what a line of input is depends on whether you've messed around with $/;