go ahead... be a heretic | |
PerlMonks |
Re: Split and Pattern Matchby djantzen (Priest) |
on Jun 06, 2003 at 15:54 UTC ( [id://263734]=note: print w/replies, xml ) | Need Help?? |
Does "1 word here another word" mean you have word pairs like "foo bar", "baz quux", or "foo bar baz quux"? Assuming the former, you can break that up like so:
Note that if you split on the whitespace it will already be stripped from the returned strings, so no extra processing should be necessary. For the second question, a match will do the trick:
Alternatively you could use substr.
"The dead do not recognize context" -- Kai, Lexx
In Section
Seekers of Perl Wisdom
|
|