in reply to How to find a string after matching a Keyword

This match returns all groups in list context but there is only one value you can grab with ($y) (a one element list)

Try an @array instead or call it in a loop in scalar context (ie grabbing with $1)

Furthermore it seems like a \s+ is missing where you test for whitespace.

Cheers Rolf

PS: Je suis Charlie!