bonjour,

je débute totalement en PERL (j'ai commencé hier après-midi ;-)) et j'ai un petit souci: lorsque je fait le code ci dessous, au moment du print "$ligne1";print"toto", il m'affiche systématiquement d'abord toto, PUIS le contenu de la ligne courante lue dans le fichier INFILE1...

A noter que je suis sous Linux...

Qqun aurait-il une ébauche de réponse permetant d'aviter ce problème? ça m'aiderait bcp...merci grandement d'avance


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!usr/bin env perl
 
open(INFILE1,"interactions_2hdm.dat") or die "No Interaction File->Abort";
open(INFILE2,"vertices.mdl") or die "No vertices file->Abort";
open(OUTFILE,">Converted_interaction_file.dat") or die "No writing possibilities->Abort";
while($ligne1=<INFILE1>){
        unless ($ligne1 =~ /#/){
                @count[22];@count=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
                print $ligne1;print"toto";
                $string1=$ligne1;
                while($string1=~ /u\s/g){$count[0]++;}
                while($string1=~ /d\s/g){$count[1]++;}
                while($string1=~ /c\s/g){$count[2]++;}
                while($string1=~ /s\s/g){$count[3]++;}
                while($string1=~ /b\s/g){$count[4]++;}
                while($string1=~ /t\s/g){$count[5]++;}
                while($string1=~ /e\W/g){$count[6]++;}
                while($string1=~ /mu\W/g){$count[7]++;}
                while($string1=~ /ta\W/g){$count[8]++;}
                while($string1=~ /ve\s/g){$count[9]++;}
                while($string1=~ /vm\s/g){$count[10]++;}
                while($string1=~ /vt\s/g){$count[11]++;}
                while($string1=~ /g\s/g){$count[12]++;}
                while($string1=~ /w\+/g){$count[13]++;}
                while($string1=~ /w\-/g){$count[14]++;}
                while($string1=~ /z\s/g){$count[15]++;}
                while($string1=~ /h\+ /g){$count[16]++;}
                while($string1=~ /h\- /g){$count[17]++;}
                while($string1=~ /a\s/g){$count[18]++;}
                while($string1=~ /h1/g){$count[19]++;}
                while($string1=~ /h2/g){$count[20]++;}
                while($string1=~ /h3/g){$count[21]++;}
 
 
        }
}
close INFILE1;
close INFILE2;
close OUTFILE;


[Edit]
Balises [code] et [/code] ajoutées par 2eurocents.
Merci d'y penser la prochaine fois
[/Edit]