in reply to Re^2: map and grep one-liner problem
in thread map and grep one-liner problem

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 ?)

Replies are listed 'Best First'.
Re^4: map and grep one-liner problem
by jeanluca (Deacon) on Mar 14, 2007 at 16:48 UTC
    I see! Your one-liners confused me, they are hard to read :)

    Thnx a lot!
    LuCa