http://www.perlmonks.org?node_id=682623


in reply to First word

you could also use split (There's more than one way to do it)
$y=split(/\s/,$x)[0];
Update: at first, it sounds a good solution, but I'm not sure after all...