Bonjour a tous
voila j'ai une petite question concernant un while.
La boucle while pacours un gros fichier et le probleme c est que je voudrais mettre une condition sur le while pourqu une fois que l on a matcher la bonne ligne le parcours s arrete !!
genre
toto=1
while(condition)&toto==1
if(va matcher)
toto=0 et l on reboucle et le while s arrete !!
C est possible ca ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 while ($Lecture_Fichier_Mib_Cisco = <Fichier_mib_cisco>) { $Bonne_Ligne_Fichier_Mib = $Lecture_Fichier_Mib_Cisco if ( $Lecture_Fichier_Mib_Cisco =~ m/^(.*{ ciscoProducts $Numero_Switch_Type }.*)$/) ; if ( $Lecture_Fichier_Mib_Cisco =~ m/^(.*{ ciscoProducts $Numero_Switch_Type }.*)$/) { ($Nom_Type_Switch,@_Mauvaise_Partie) = split /\s/,$Bonne_Ligne_Fichier_Mib; } }
Merci d avance Jules
Partager