#!/usr/local/bin/perl my $ligne; my $corpus = "file.txt"; #some text in a variable open (CORPUS,"<$corpus") or die "erreur de texte d'origine"; while($ligne=){ $ligne=~s/^\s*//; #if line begins with one or sev. spaces, replace by nothing if($ligne=~m/$\./){ #if line ends with a dot, print "$1\"; #add
} print "$ligne"; }