#!/usr/bin/perl
print("Quel mot voulez-vous rechercher :");
$cherche = <STDIN>;
chop($cherche);
$ligne="0";
$sum="0";
$cond="0";
while(<>){
$cond=$sum;
$ligne +=1;
$sum += (s/\b$cherche\b/$cherche/g);
if($cond != $sum){
print("Ligne $ligne ==> ");
print("$sum\n");
};
};
print("----------------------------------------------------\n");
print("Votre fichier contient $sum fois le mot \'$cherche\'\n");