while(<IN>) { $yline=$_; chomp($yline); $yline =~ s/\cM\cJ|\cM|\cJ/ /g; #returns et al $yline =~ s/^\s+//g; #Leading spaces $yline =~ s/\s\s+/ /g; #Trailing spaces @yline = split (/(?<=\.)/, $yline); #splits line but retains full + stop #@yline = split ($yline =~ /(.*?(?:\.|$))\s*/g);#grabs anything af +ter #@yline = split (/\./, $yline); foreach(@yline){ print "$_\n"; }
In reply to Capturing Space with Split by Gavin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |