in reply to Perl split
"..but retain the full stops for future use.."
Just use capturing parentheses with your split. eg:
Update: I guess I should have explained a little. From perldoc -f split:@line = split(/(\.)/,$line);
If the PATTERN contains parentheses, additional list elements are crea +ted from each matching substring in the delimiter.
The best way to understand this is by example:
Which gives:while(<DATA>) { $line=$_; chomp($line); @line = split(/(\.)/,$line); } print Dumper(@line); __DATA__ The quick. Brown fox. Jumps over the. Lazy dog.
@line = ( 'The quick', '.', ' Brown fox', '.', ' Jumps over the', '.', ' Lazy dog', '.' );
Cheers,
Darren :)
|
|---|