I generally think 'hey, this does work. but my perl skills in this area are AWFUL. i know that this is using a lot more loops and memory than necessary. and i KNOW that there's a better way to do this, because if every application I use had code like this, my computer just wouldn't run. i need to learn the best, most efficient way to perform this task and take that learning into other functions that i program."
Beware of thinking that the most efficient solution is the "best" - often, the best solution may not be the most efficient solution possible, but the cleanest, most maintainable, most flexible, etc...