my $string = q(So anyway, I basically need to check now across my string whether any elements in my string are repeated, and if so, how many times. I've read alot about manipulating arrays, but they're all based on arrays that you create yourself, rather than arrays created by opening a textfile, so I'm not sure how to manipulate my array. Any help would be much appreciated.); my %positions; push @{$positions{lc($1)}}, pos() - length($1) while $string =~ /([A-Za-z']+)/g; { local $_; print "$_\t@{$positions{$_}}\n" for keys %positions; }