NewMonkMark has asked for the wisdom of the Perl Monks concerning the following question:
Hi there, could be I'm very tired today, but I cannot understand that behavior:
(I'm on Win XP64) when I run the following code it blocks at filehandle reading - while(my $ln = <DB>) - with the CPU working at full capacity.
I did some attempts in the hope of understand, I could only report that if I read the filehandle before enter the while cicle it works (as in the second example below), I checked the rest of the program for some strange interaction with that file and filehandle name (I tried unused FH name) but there is still something wrong.
Who have some hint? what could I have to check in the rest of the code? Thank you in advance.
The following code Blocks
The followings WorksFOR: foreach my $F($DB_PRI{FILE},$DB_OGGI{FILE}) { open(DB,"<$F") || &ERROR('CANNOT OPEN 1325'); while(my $ln = <DB>) { ...
FOR: foreach my $F($DB_PRI{FILE},$DB_OGGI{FILE}) { open(DB,"<$F") || &ERROR('CANNOT OPEN 1325'); my $line = <DB>; # this line frees the following while while(my $ln = <DB>) { ...
|
|---|