I can see why benchmarking such a simple expression is trivial. I suppose there are several lessons learned here.
- Thanks to BrowserUk it is clear that in this particular situation the memory conservative:
print "$_ : $h{ $_ }\n" for sort keys %h;
is the best choice taking both efficiency and elegance into consideration.
- I learned how to benchmark my subroutines which will hopefully be of service as I learn to write more complex code
- And possibly most importantly I need to update my study materials!!!
Thanks again everybody!