What exactly does the last part do ( . ' ' ), adding a space ?
Yes, that's exactly what it does. Otherwise, as johngg points out above, a search for 'b' will match not just 'b', but also, for example, 'bbking'. And if you look closely at this line in Anno's solution:
my @values = map / (.*)/, grep /^$key /, @ta;you'll see that he does the same thing (note the space after ^$key ?)
In reply to Re^3: map and grep one-liner problem
by Not_a_Number
in thread map and grep one-liner problem
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |