Change this:
my @sentence = split(/\W+/,$line);
to:
my @sentence = split(/(\W+)/,$line);
Now @sentence will contain the punctuation as well.
In reply to Re^2: Match first word in line fails
by Anonymous Monk
in thread Match first word in line fails
by yacoubean
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |