I think you just need a reassuring pad on the back here footpad
You're looking for a direct case sensitive match and used eq, which is perfect.
You want to preserve the order of the values. You could build a hash where the key is the arrayindex of the value. eg my %data = ( 1 => 'test1', 2 => 'test2', 3 => 'test3); I would see this as unnecessary complication. The usage of an array is perfectly adequate here.
Grep is inefficient yes because it searches ALL the matches and thus always loops your entire list.
Basically I like the code you've written, it's easy to understand, maintainable, fits it's purpose and didn't take you long to write.
Now if only all code was as easy this....
"Do or do not, there is no try" -- Yoda