Next | Program Repair Shop | 156 |
For example, consider this common idiom:
print CLIENT "['" . join("','" => @keys) . "']", EOL;
Its purpose is to produce a string like this one:
['key1','key2','key3','key4','key5','key6']
This rule suggests that it might be better written like this:
print CLIENT "[", join("," => map("'$_'", @keys)), "]", EOL;
It's a little longer
But it might be clearer - the original code has a 'trick'
What do you think?
Next | Copyright © 2002 M. J. Dominus |