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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: First word
by FunkyMonk (Chancellor) on Apr 24, 2008 at 08:56 UTC | |
Re: First word
by andreas1234567 (Vicar) on Apr 24, 2008 at 08:56 UTC | |
by Anonymous Monk on Apr 24, 2008 at 09:10 UTC | |
by toolic (Bishop) on Apr 24, 2008 at 13:32 UTC | |
Re: First word
by cdarke (Prior) on Apr 24, 2008 at 12:26 UTC | |
Re: First word
by haoess (Curate) on Apr 24, 2008 at 08:56 UTC | |
by grizzley (Chaplain) on Apr 24, 2008 at 09:49 UTC | |
Re: First word
by jeepj (Scribe) on Apr 24, 2008 at 12:50 UTC |
Back to
Seekers of Perl Wisdom