This will do it for you.
Sample text file:
C:\Temp>type t.txt
This is a test sentence. And this is another one; Also so is this.
And by the way, this is the fourth sentence.
Now the perl code:
#!/usr/bin/perl
use strict;
use warnings;
my $s;
my @arr;
open(FILE, "<t.txt");
while(<FILE>) {
chomp $_;
$s .= $_;
}
@arr = $s =~ m/[A-Z].+?[.;]/g;
foreach (@arr) {
print $_, "\n";
}
Now the output:
C:\Temp>t.pl
This is a test sentence.
And this is another one;
Also so is this.
And by the way, this is the fourth sentence.
as you can see, each array position in
@arr contains 1 sentence (as you have defined it).
hope this helps,
davidj