in reply to I don't get map. How would I use map here?
If you do not need a list returned, (which is the case in your example),use for.
Update:Style suggestion:
Your second loop is better written as
This is more idiomatic, uses less memory, and is faster than your loop.while (my ($k,$v) = each %byFile ) { print "$k\t=>$v\n"; }
Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarantees offense.
|
|---|