shaezi,
Instead of pushing to an array if it isn't present in a hash, just use a hash since the key will remain the same but the value will keep changing. You can use an array to keep insert order since it seems to be important to you.
for ( @data ) {
my $key = substr($_, 0, 7);
push @order, $key if ! defined $unique{$key};
$unique{$key} = $_;
}
print "$_ : $unique{$key}\n" for @data{@order};