On Fri, 15 Feb 2002, Agustin Rivera wrote:
> How would I keep the character (or characters) that I am splitting by?
>
> for example,
>
> @tags=split(/>/, $line);
>
> I would like to keep the ">".
In other words, you have the string 'blah>bluh>blug>', you want to split
it, and end up with ("blah>", "bluh>", "blug>") ?
You can do
split /(>)/, $line
This would give you ("blah", ">", "bluh", ">", "blug", ">").
Otherwise, you'd probably need to do a general regular expression and pull
apart the string.
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
Blessed are the forgetful: for they get the better even of their blunders.
-- Nietzsche
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]