At 2:16 PM -0500 11/14/10, shawn wilson wrote:
so, if you've got a file, do something like:

while ($line = <FH> ) {
 $line =~ m/^(.+)$/ig;
 print "<s>$1<\/s>\n";
}

If all you want to do is print each line in the file surrounded by<s> tags, you don't need regular expressions, and you don't need to escape forward slash characters in double-quotes:

while ($line = <FH> ) {
  chomp($line);
  print "<s>$line</s>\n";
}

As Rob said, the hard thing with this task is finding out where sentences begin and end.

--
Jim Gibson
j...@gibson.org

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to