![]() |
|
There's more than one way to do things | |
PerlMonks |
First wordby Anonymous Monk |
on Apr 24, 2008 at 08:50 UTC ( #682581=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hey guys, I have a string $x in a scalar, and I need to copy the first 'word' of string to $y and I can't seem to find anywhere how to do it.
I know that \w 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 $x[0].
Many thanks, Bill
Back to
Seekers of Perl Wisdom
|
|