in reply to map in void context
The essential difference between ucfirst and map is (with respect to void context), that ucfrist does nothing but return something, while the code executed via map may have side effects. Thus, the former is clearly 'useless', while the latter could be potentially 'useful'. Still, it usually isn't considered good practice to use map in void context (use for instead, e.g. $sum += $index{$_} for split (//,$word);).
|
|---|