hi to all,
i have a problem with foreach loops .
this is the loop
#!/usr/local/bin/perl
open(FILE,looptest);
@array=qw(one two three four);
foreach $i (@array){
print "$i \n";
while(<FILE>){
print "$_\n";
}
}
my problem is that the while statemnt only gets executed once !
why is that ?
i have a problem with foreach loops .
this is the loop
#!/usr/local/bin/perl
open(FILE,looptest);
@array=qw(one two three four);
foreach $i (@array){
print "$i \n";
while(<FILE>){
print "$_\n";
}
}
my problem is that the while statemnt only gets executed once !
why is that ?