perlquestion
Anonymous Monk
Hey guys, I have a string <code>$x</code> in a scalar, and I need to copy the first 'word' of string to <code>$y</code> and I can't seem to find anywhere how to do it.
I know that <code>\w</code> would be the regex for a 'word' and know how to match it, but how do I capture it in another variable without having to split the whole string then just copy <code>$x[0]</code>.
Many thanks, Bill
7