in reply to Perl split
McDarren's response will get you the full stops in a separate entry in the array. The other alternative is using zero-width assertions. In this case, I suspect you want the full stop associated with the sentence before, so I would use a look-behind assertion since you want to split in between the full stop and the next character.
@line = split (/(?<=\.)/, $line);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl split
by Gavin (Archbishop) on Mar 12, 2006 at 15:29 UTC |