in reply to Find the word????

we must know how the other lines look like.
$s = "samir: 23 yearold"; $s =~ m{(.*) \s yearold \z}xms; print $1
would for example fetch everything before " yearold" (at the end of the string);